linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [patch] UBI: clean up return in ubi_remove_volume()
@ 2016-04-13  6:41 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2016-04-13  6:41 UTC (permalink / raw)
  To: Artem Bityutskiy, Dmitry Pervushin
  Cc: Richard Weinberger, David Woodhouse, Brian Norris, linux-mtd,
	kernel-janitors

My static checker says that "err" can be uninitialized if
"vol->reserved_pebs" is <= 0.  I don't think that can happen but
returning a literal is cleaner anyway.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c
index 1ae17bb..10059df 100644
--- a/drivers/mtd/ubi/vmt.c
+++ b/drivers/mtd/ubi/vmt.c
@@ -405,7 +405,7 @@ int ubi_remove_volume(struct ubi_volume_desc *desc, int no_vtbl)
 	if (!no_vtbl)
 		self_check_volumes(ubi);
 
-	return err;
+	return 0;
 
 out_err:
 	ubi_err(ubi, "cannot remove volume %d, error %d", vol_id, err);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-04-13  6:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-13  6:41 [patch] UBI: clean up return in ubi_remove_volume() Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).