1
0
Fork 0

nvme: Fix uninitialized-variable warning

[ Upstream commit 15755854d5 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
5.4-rM2-2.2.x-imx-squashed
Keith Busch 2020-02-20 00:59:36 +09:00 committed by Greg Kroah-Hartman
parent b290fb0b79
commit 9b6be0d2f9
1 changed files with 1 additions and 1 deletions

View File

@ -1161,8 +1161,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));