diff options
author | Keith Busch <kbusch@kernel.org> | 2020-02-20 00:59:36 +0900 |
---|---|---|
committer | Keith Busch <kbusch@kernel.org> | 2020-02-20 01:40:57 +0900 |
commit | 15755854d53b4bbb0bb37a0fce66f0156cfc8a17 (patch) | |
tree | 95c8de5879a7882b922dd99b2b2bbcc035c64d4c | |
parent | 98f7b86a0becc1154b1a6df6e75c9695dfd87e0d (diff) | |
download | linux-15755854d53b4bbb0bb37a0fce66f0156cfc8a17.tar.bz2 |
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 <arnd@arndb.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
-rw-r--r-- | drivers/nvme/host/core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index ada59df642d2..a4d8c90ee7cc 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1165,8 +1165,8 @@ static int nvme_identify_ns(struct nvme_ctrl *ctrl, static int nvme_features(struct nvme_ctrl *dev, u8 op, unsigned int fid, unsigned int dword11, void *buffer, size_t buflen, u32 *result) { + union nvme_result res = { 0 }; struct nvme_command c; - union nvme_result res; int ret; memset(&c, 0, sizeof(c)); |