All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] mtd: add Samsung SoC OneNAND driver
@ 2016-11-24 10:45 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2016-11-24 10:45 UTC (permalink / raw)
  To: kyungmin.park; +Cc: linux-mtd

Hello Kyungmin Park,

The patch 46f3e88bd9da: "mtd: add Samsung SoC OneNAND driver" from
Apr 28, 2010, leads to the following static checker warning:

	drivers/mtd/onenand/samsung.c:876 s3c_onenand_probe()
	info: ignoring unreachable code.

drivers/mtd/onenand/samsung.c
   858          onenand = kzalloc(sizeof(struct s3c_onenand), GFP_KERNEL);
   859          if (!onenand) {
   860                  err = -ENOMEM;
   861                  goto onenand_fail;
   862          }
   863  
   864          this = (struct onenand_chip *) &mtd[1];
   865          mtd->priv = this;
   866          mtd->dev.parent = &pdev->dev;
   867          onenand->pdev = pdev;
   868          onenand->type = platform_get_device_id(pdev)->driver_data;
   869  
   870          s3c_onenand_setup(mtd);
   871  
   872          r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   873          if (!r) {
   874                  dev_err(&pdev->dev, "no memory resource defined\n");
   875                  return -ENOENT;
   876                  goto ahb_resource_failed;

We should probably do a goto but problem not that one.  It looks like
maybe "goto resource_failed;"?  Best to name the gotos after what they
do instead of using come-from names that describe the goto location.
"goto free_onenand;".

   877          }
   878  
   879          onenand->base_res = request_mem_region(r->start, resource_size(r),
   880                                                 pdev->name);
   881          if (!onenand->base_res) {
   882                  dev_err(&pdev->dev, "failed to request memory resource\n");
   883                  err = -EBUSY;
   884                  goto resource_failed;
   885          }
   886  

regards,
dan carpenter

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

only message in thread, other threads:[~2016-11-24 10:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-24 10:45 [bug report] mtd: add Samsung SoC OneNAND driver Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.