LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* net/mctp/test/utils.c:15 mctp_test_dev_tx() error: use kfree_skb() here instead of kfree(skb)
@ 2021-11-25  7:05 Dan Carpenter
  2021-11-29  2:24 ` Jeremy Kerr
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2021-11-25  7:05 UTC (permalink / raw)
  To: kbuild, Jeremy Kerr; +Cc: lkp, kbuild-all, linux-kernel

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   5f53fa508db098c9d372423a6dac31c8a5679cdf
commit: ded21b72299529cc143a4213ea0ec4b0c620b8eb mctp: Add test utils
config: x86_64-randconfig-m001-20211122 (https://download.01.org/0day-ci/archive/20211125/202111250652.KJ5iJFpx-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
net/mctp/test/utils.c:15 mctp_test_dev_tx() error: use kfree_skb() here instead of kfree(skb)

vim +15 net/mctp/test/utils.c

ded21b72299529c Jeremy Kerr 2021-10-03  12  static netdev_tx_t mctp_test_dev_tx(struct sk_buff *skb,
ded21b72299529c Jeremy Kerr 2021-10-03  13  				    struct net_device *ndev)
ded21b72299529c Jeremy Kerr 2021-10-03  14  {
ded21b72299529c Jeremy Kerr 2021-10-03 @15  	kfree(skb);

This should be kfree_skb(skb);

ded21b72299529c Jeremy Kerr 2021-10-03  16  	return NETDEV_TX_OK;
ded21b72299529c Jeremy Kerr 2021-10-03  17  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org


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

* Re: net/mctp/test/utils.c:15 mctp_test_dev_tx() error: use kfree_skb() here instead of kfree(skb)
  2021-11-25  7:05 net/mctp/test/utils.c:15 mctp_test_dev_tx() error: use kfree_skb() here instead of kfree(skb) Dan Carpenter
@ 2021-11-29  2:24 ` Jeremy Kerr
  2021-11-29  7:53   ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Jeremy Kerr @ 2021-11-29  2:24 UTC (permalink / raw)
  To: Dan Carpenter, kbuild; +Cc: lkp, kbuild-all, linux-kernel

Hi Dan,

> smatch warnings:
> net/mctp/test/utils.c:15 mctp_test_dev_tx() error: use kfree_skb() here instead of kfree(skb)

Thanks for the report! I've sent a fix, you're CCed.

However, I can 't seem to recreate the smatch warning; could you include
the build command you're using for these? I've tried with

    make [...] C=1 CHECK=/path/to/smatch

using smatch 4f2585888, but that doesn't report the error you've listed
there. Do I need any specific CHECKFLAGS?

Cheers,


Jeremy


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

* Re: net/mctp/test/utils.c:15 mctp_test_dev_tx() error: use kfree_skb() here instead of kfree(skb)
  2021-11-29  2:24 ` Jeremy Kerr
@ 2021-11-29  7:53   ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2021-11-29  7:53 UTC (permalink / raw)
  To: Jeremy Kerr; +Cc: kbuild, lkp, kbuild-all, linux-kernel

On Mon, Nov 29, 2021 at 10:24:15AM +0800, Jeremy Kerr wrote:
> Hi Dan,
> 
> > smatch warnings:
> > net/mctp/test/utils.c:15 mctp_test_dev_tx() error: use kfree_skb() here instead of kfree(skb)
> 
> Thanks for the report! I've sent a fix, you're CCed.
> 
> However, I can 't seem to recreate the smatch warning; could you include
> the build command you're using for these? I've tried with
> 
>     make [...] C=1 CHECK=/path/to/smatch

The CHECK= string needs a -p=kernel added to it or it won't do kernel
specific checking.

	make [...] C=1 CHECK="/path/to/smatch -p=kernel"

regards,
dan carpenter


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

end of thread, other threads:[~2021-11-29  7:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-25  7:05 net/mctp/test/utils.c:15 mctp_test_dev_tx() error: use kfree_skb() here instead of kfree(skb) Dan Carpenter
2021-11-29  2:24 ` Jeremy Kerr
2021-11-29  7:53   ` Dan Carpenter

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