Message ID | 20180221230252.16632-3-vishal.l.verma@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/ndctl/update.c b/ndctl/update.c index 877d37f..71d95eb 100644 --- a/ndctl/update.c +++ b/ndctl/update.c @@ -208,7 +208,7 @@ static int send_firmware(struct update_context *uctx) { struct ndctl_cmd *cmd = NULL; ssize_t read; - int rc; + int rc = -ENXIO; enum ND_FW_STATUS status; struct fw_info *fw = &uctx->dimm_fw; uint32_t copied = 0, len, remain;
In send_firmware, if the file size ('remain') were to be zero, 'rc' would never get assigned. While this conditon would never be reached because we have already checked the file size to be greater than zero, initialize 'rc' anyway to silence the compiler warning. Cc: Dan Williams <dan.j.williams@intel.com> Cc: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com> --- ndctl/update.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)