From: Fengguang Wu <fengguang.wu@intel.com>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: Yuanhan Liu <yuanhan.liu@linux.intel.com>,
changlongx.xie@intel.com,
Steve Glendinning <steve.glendinning@smsc.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
linux-usb@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [net-next:master 209/235] drivers/net/usb/smsc95xx.c:1134:39-50: ERROR: reference preceded by free on line 1136
Date: Thu, 8 Nov 2012 20:40:24 +0800 [thread overview]
Message-ID: <20121108124024.GA9627@localhost> (raw)
In-Reply-To: <alpine.DEB.2.02.1211080907340.1945@localhost6.localdomain6>
Julia,
On Thu, Nov 08, 2012 at 09:08:04AM +0100, Julia Lawall wrote:
> It's a false positive because check_warn_return does a return.
Right.
> But I wonder if there is a way that we can encourage people not to
> do things like that?
Well I suspect the memory leak bug 06a221be0 tries to fix might be
due to check_warn_return() hiding the otherwise very obvious syntax
highlighted 'return' statement.
Thanks,
Fengguang
> >TO: Ming Lei <ming.lei@canonical.com>
> >CC: netdev@vger.kernel.org
> >
> >
> >Hi Ming,
> >
> >FYI, there are coccinelle warnings in
> >
> >tree: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
> >head: f1e0b5b4f1eae56a3192688177f36e2bdf0e01ac
> >commit: 06a221be022c2cc98a48e0808a4ef0dc8f0b3a34 [209/235] usbnet: smsc95xx: fix memory leak in smsc95xx_suspend
> >:::::: branch date: 8 hours ago
> >:::::: commit date: 23 hours ago
> >
> >+ drivers/net/usb/smsc95xx.c:1134:39-50: ERROR: reference preceded by free on line 1136
> > drivers/net/usb/smsc95xx.c:1139:8-19: ERROR: reference preceded by free on line 1136
> >
> >git remote update net-next
> >git checkout 06a221be022c2cc98a48e0808a4ef0dc8f0b3a34
> >vim +1134 drivers/net/usb/smsc95xx.c
> >
> >bbd9f9ee Steve Glendinning 2012-10-26 1128 offset[filter/4] |= 0x00 << ((filter % 4) * 8);
> >bbd9f9ee Steve Glendinning 2012-10-26 1129 crc[filter/2] |= smsc_crc(dev->net->dev_addr, ETH_ALEN, filter);
> >bbd9f9ee Steve Glendinning 2012-10-26 1130 filter++;
> >bbd9f9ee Steve Glendinning 2012-10-26 1131 }
> >bbd9f9ee Steve Glendinning 2012-10-26 1132
> >bbd9f9ee Steve Glendinning 2012-10-26 1133 for (i = 0; i < (pdata->wuff_filter_count * 4); i++) {
> >bbd9f9ee Steve Glendinning 2012-10-26 @1134 ret = smsc95xx_write_reg(dev, WUFF, filter_mask[i]);
> >06a221be Ming Lei 2012-11-06 1135 if (ret < 0)
> >06a221be Ming Lei 2012-11-06 @1136 kfree(filter_mask);
> >bbd9f9ee Steve Glendinning 2012-10-26 1137 check_warn_return(ret, "Error writing WUFF");
> >bbd9f9ee Steve Glendinning 2012-10-26 1138 }
> >06a221be Ming Lei 2012-11-06 1139 kfree(filter_mask);
> >
> >:::::: The code at line 1134 was first introduced by commit:
> >:::::: bbd9f9e smsc95xx: add wol support for more frame types
> >
> >:::::: TO: Steve Glendinning <steve.glendinning@shawell.net>
> >:::::: CC: David S. Miller <davem@davemloft.net>
> >
> >---
> >0-DAY kernel build testing backend Open Source Technology Center
> >Fengguang Wu, Yuanhan Liu Intel Corporation
> >
parent reply other threads:[~2012-11-08 12:40 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <alpine.DEB.2.02.1211080907340.1945@localhost6.localdomain6>]
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=20121108124024.GA9627@localhost \
--to=fengguang.wu@intel.com \
--cc=changlongx.xie@intel.com \
--cc=julia.lawall@lip6.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=steve.glendinning@smsc.com \
--cc=yuanhan.liu@linux.intel.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 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.