Skip to content

Commit 1575585

Browse files
committed
nvme: Fix uninitialized-variable warning
gcc may detect a false positive on nvme using an unintialized variable if setting features fails. Since this is not a fast path, explicitly initialize this variable to suppress the warning. Reported-by: Arnd Bergmann <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent 98f7b86 commit 1575585

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/nvme/host/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1165,8 +1165,8 @@ static int nvme_identify_ns(struct nvme_ctrl *ctrl,
11651165
static int nvme_features(struct nvme_ctrl *dev, u8 op, unsigned int fid,
11661166
unsigned int dword11, void *buffer, size_t buflen, u32 *result)
11671167
{
1168+
union nvme_result res = { 0 };
11681169
struct nvme_command c;
1169-
union nvme_result res;
11701170
int ret;
11711171

11721172
memset(&c, 0, sizeof(c));

0 commit comments

Comments
 (0)