public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [bug report] UBI: Fastmap: Do not add vol if it already exists
@ 2016-10-25 20:46 Dan Carpenter
  2016-10-26  1:46 ` Sheng Yong
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2016-10-25 20:46 UTC (permalink / raw)
  To: shengyong1; +Cc: linux-mtd

Hello shengyong,

The patch e96a8a3bb671: "UBI: Fastmap: Do not add vol if it already
exists" from May 26, 2015, leads to the following static checker
warning:

	drivers/mtd/ubi/fastmap.c:712 ubi_attach_fastmap()
	warn: PTR_ERR(av) is never (-22)

drivers/mtd/ubi/fastmap.c
   703  
   704                  av = add_vol(ai, be32_to_cpu(fmvhdr->vol_id),
   705                               be32_to_cpu(fmvhdr->used_ebs),
   706                               be32_to_cpu(fmvhdr->data_pad),
   707                               fmvhdr->vol_type,
   708                               be32_to_cpu(fmvhdr->last_eb_bytes));
   709  
   710                  if (!av)
   711                          goto fail_bad;
   712                  if (PTR_ERR(av) == -EINVAL) {

av is either -EEXIST or -ENOMEM.  It's never -EINVAL.

   713                          ubi_err(ubi, "volume (ID %i) already exists",
   714                                  fmvhdr->vol_id);
   715                          goto fail_bad;
   716                  }
   717  

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-10-26 11:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-25 20:46 [bug report] UBI: Fastmap: Do not add vol if it already exists Dan Carpenter
2016-10-26  1:46 ` Sheng Yong
2016-10-26  8:25   ` Dan Carpenter
2016-10-26  9:23     ` Boris Brezillon
2016-10-26 11:30       ` Sheng Yong
2016-10-26 11:28     ` Sheng Yong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox