mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
nvme: initialize variable before logical OR'ing it
It is typically not good coding or secure coding practice to logical OR a variable without an initialization value first. Here on this line: integrity.flags |= BLK_INTEGRITY_DEVICE_CAPABLE; BLK_INTEGRITY_DEVICE_CAPABLE is being OR'ed to a member variable never set to an initial value. This patch fixes that. Signed-off-by: Jay Freyensee <[email protected]> Reviewed-by: Ming Lin <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
f9cc4472c9
commit
fa9a89fc66
1 changed files with 1 additions and 0 deletions
|
|
@ -842,6 +842,7 @@ static void nvme_init_integrity(struct nvme_ns *ns)
|
|||
{
|
||||
struct blk_integrity integrity;
|
||||
|
||||
memset(&integrity, 0, sizeof(integrity));
|
||||
switch (ns->pi_type) {
|
||||
case NVME_NS_DPS_PI_TYPE3:
|
||||
integrity.profile = &t10_pi_type3_crc;
|
||||
|
|
|
|||
Loading…
Reference in a new issue