nvme: Fix uninitialized-variable warning
Keith Busch
maintainerPATCH 1/1 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]>
Signed-off-by Keith Busch <[email protected]>
--- drivers/nvme/host/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/core.c +1 -1
@@ -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));
Signature · 7 lines
2.21.0 _______________________________________________ linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Quoted 6 lines · Keith Busch
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]>Signed-off-by Keith Busch <[email protected]>
Looks good,
Reviewed-by Christoph Hellwig <[email protected]>
_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Reviewed-by Sagi Grimberg <[email protected]>
_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme