netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch - Nicholas's tree] netconsole: Missing unlock on error path
@ 2015-10-03 19:05 Dan Carpenter
  2015-10-03 19:23 ` kbuild test robot
  2015-10-04  6:36 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2015-10-03 19:05 UTC (permalink / raw)
  To: Tejun Heo, Christoph Hellwig
  Cc: Andrew Morton, Nicholas Bellinger, David S. Miller, netdev,
	kernel-janitors

We added new locking to this function but we missed one error path which
needs an unlock.

Fixes: cdacad4993f4 ('netconsole: use per-attribute show and store methods')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This is going through Nicholas Bellinger's tree not net-next.

diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 8783169..06ee639 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -535,7 +535,7 @@ static ssize_t remote_ip_store(struct config_item *item, const char *buf,
 		if (in6_pton(buf, count, nt->np.remote_ip.in6.s6_addr, -1, &end) > 0) {
 			if (*end && *end != '\n') {
 				pr_err("invalid IPv6 address at: <%c>\n", *end);
-				return -EINVAL;
+				goto out_unlock;
 			}
 			nt->np.ipv6 = true;
 		} else

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

* Re: [patch - Nicholas's tree] netconsole: Missing unlock on error path
  2015-10-03 19:05 [patch - Nicholas's tree] netconsole: Missing unlock on error path Dan Carpenter
@ 2015-10-03 19:23 ` kbuild test robot
  2015-10-04  6:36 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: kbuild test robot @ 2015-10-03 19:23 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: kbuild-all, Tejun Heo, Christoph Hellwig, Andrew Morton,
	Nicholas Bellinger, David S. Miller, netdev, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1392 bytes --]

Hi Dan,

[auto build test results on v4.3-rc3 -- if it's inappropriate base, please ignore]

config: x86_64-allmodconfig (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All error/warnings (new ones prefixed by >>):

   drivers/net/netconsole.c:507:33: sparse: label 'out_unlock' was not declared
   drivers/net/netconsole.c: In function 'store_remote_ip':
>> drivers/net/netconsole.c:507:5: error: label 'out_unlock' used but not defined
        goto out_unlock;
        ^

sparse warnings: (new ones prefixed by >>)

>> drivers/net/netconsole.c:507:33: sparse: label 'out_unlock' was not declared
   drivers/net/netconsole.c: In function 'store_remote_ip':
   drivers/net/netconsole.c:507:5: error: label 'out_unlock' used but not defined
        goto out_unlock;
        ^

vim +/out_unlock +507 drivers/net/netconsole.c

   501	
   502		if (strnchr(buf, count, ':')) {
   503			const char *end;
   504			if (in6_pton(buf, count, nt->np.remote_ip.in6.s6_addr, -1, &end) > 0) {
   505				if (*end && *end != '\n') {
   506					pr_err("invalid IPv6 address at: <%c>\n", *end);
 > 507					goto out_unlock;
   508				}
   509				nt->np.ipv6 = true;
   510			} else

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 50052 bytes --]

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

* Re: [patch - Nicholas's tree] netconsole: Missing unlock on error path
  2015-10-03 19:05 [patch - Nicholas's tree] netconsole: Missing unlock on error path Dan Carpenter
  2015-10-03 19:23 ` kbuild test robot
@ 2015-10-04  6:36 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2015-10-04  6:36 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Tejun Heo, Christoph Hellwig, Andrew Morton, Nicholas Bellinger,
	David S. Miller, netdev, kernel-janitors

On Sat, Oct 03, 2015 at 10:05:24PM +0300, Dan Carpenter wrote:
> We added new locking to this function but we missed one error path which
> needs an unlock.
> 
> Fixes: cdacad4993f4 ('netconsole: use per-attribute show and store methods')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> This is going through Nicholas Bellinger's tree not net-next.

Hi Dan,

this was fixed a while ago, I'm actually surpised it was still in the patches
Nic merged.  My repost from earlier yesterday should have fixed it.

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

end of thread, other threads:[~2015-10-04  6:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-03 19:05 [patch - Nicholas's tree] netconsole: Missing unlock on error path Dan Carpenter
2015-10-03 19:23 ` kbuild test robot
2015-10-04  6:36 ` Christoph Hellwig

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).