Re: [PATCH] lightnvm: fix "warning: ‘ret’ may be used uninitialized"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/04/2016 08:05 PM, Jeff Mahoney wrote:
This fixes the following warnings:
drivers/lightnvm/sysblk.c:125:9: warning: ‘ret’ may be used
uninitialized in this function

drivers/lightnvm/sysblk.c:275:15: warning: ‘ret’ may be used
uninitialized in this function

In both cases, ret is only set from within a loop that may not be entered.

Signed-off-by: Jeff Mahoney <jeffm@xxxxxxxx>
---

  drivers/lightnvm/sysblk.c |    4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/lightnvm/sysblk.c
+++ b/drivers/lightnvm/sysblk.c
@@ -122,7 +122,7 @@ static int nvm_get_all_sysblks(struct nv
  				struct ppa_addr *ppas, nvm_bb_update_fn *fn)
  {
  	struct ppa_addr dppa;
-	int i, ret;
+	int i, ret = 0;

  	s->nr_ppas = 0;

@@ -272,7 +272,7 @@ static int nvm_write_and_verify(struct n
  {
  	struct nvm_system_block nvmsb;
  	void *buf;
-	int i, sect, ret, bufsz;
+	int i, sect, ret = 0, bufsz;
  	struct ppa_addr *ppas;

  	nvm_cpu_to_sysblk(&nvmsb, info);



Thanks Jeff. Applied for 4.7.
--
To unsubscribe from this list: send the line "unsubscribe linux-block" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux