All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kyungmin.park@samsung.com
Cc: linux-mtd@lists.infradead.org
Subject: [bug report] mtd: add Samsung SoC OneNAND driver
Date: Thu, 24 Nov 2016 13:45:59 +0300	[thread overview]
Message-ID: <20161124101817.GA14449@mwanda> (raw)

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

                 reply	other threads:[~2016-11-24 10:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161124101817.GA14449@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.