From: Dan Carpenter <dan.carpenter@oracle.com>
To: maxime.ripard@free-electrons.com
Cc: linux-gpio@vger.kernel.org
Subject: [bug report] pinctrl: sunxi: Deal with configless pins
Date: Wed, 16 Nov 2016 15:31:24 +0300 [thread overview]
Message-ID: <20161116123123.GA31631@mwanda> (raw)
Hello Maxime Ripard,
The patch e11dee2e98f8: "pinctrl: sunxi: Deal with configless pins"
from Oct 20, 2016, leads to the following static checker warning:
drivers/pinctrl/sunxi/pinctrl-sunxi.c:397 sunxi_pctrl_dt_node_to_map()
warn: variable dereferenced before check 'map' (see line 323)
drivers/pinctrl/sunxi/pinctrl-sunxi.c
394 *num_maps = i;
395
396 /*
397 * We know have the number of maps we need, we can resize our
398 * map array
399 */
400 *map = krealloc(*map, i * sizeof(struct pinctrl_map), GFP_KERNEL);
401 if (!map)
This should obviously be "if (*map) " here.
402 return -ENOMEM;
403
404 return 0;
405
406 err_free_map:
407 kfree(map);
I would send a patch, but I wasn't sure about this. Should this be
kfree(*map);? I don't have my cross function DB built for ARM so I
don't know how this is called... Maybe set *map to NULL as well before
returning?
408 return ret;
409 }
regards,
dan carpenter
next reply other threads:[~2016-11-16 12:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-16 12:31 Dan Carpenter [this message]
2016-11-17 20:24 ` [bug report] pinctrl: sunxi: Deal with configless pins Maxime Ripard
2016-11-17 21:14 ` Dan Carpenter
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=20161116123123.GA31631@mwanda \
--to=dan.carpenter@oracle.com \
--cc=linux-gpio@vger.kernel.org \
--cc=maxime.ripard@free-electrons.com \
/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 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).