Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@inria.fr>
To: Quanyang Wang <quanyang.wang@windriver.com>,
	 Michal Simek <monstr@monstr.eu>,
	Manish Narani <manish.narani@xilinx.com>
Cc: linux-arm-kernel@lists.infradead.org, kbuild-all@lists.01.org
Subject: [xilinx-xlnx:xlnx_rebase_v5.15 400/872] drivers/usb/gadget/function/f_tcm.c:340:2-12: alloc with no test, possible model on line 345 (fwd)
Date: Wed, 9 Feb 2022 12:27:55 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2202091227020.52266@hadrien> (raw)

Hello,

Please check line 342, which seems to be missing an [i].

julia

---------- Forwarded message ----------
Date: Wed, 9 Feb 2022 17:21:42 +0800
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Cc: lkp@intel.com, Julia Lawall <julia.lawall@lip6.fr>
Subject: [xilinx-xlnx:xlnx_rebase_v5.15 400/872]
    drivers/usb/gadget/function/f_tcm.c:340:2-12: alloc with no test,
    possible model on line 345

CC: kbuild-all@lists.01.org
CC: linux-arm-kernel@lists.infradead.org
TO: Quanyang Wang <quanyang.wang@windriver.com>
CC: Michal Simek <monstr@monstr.eu>
CC: Manish Narani <manish.narani@xilinx.com>

tree:   https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.15
head:   1183ce490adb103e5e569b8ebd74c50c885ddc05
commit: 52817ef9c056b35660cd1fd8cd02c3d3603c8059 [400/872] Revert "usb: function: f_tcm: Add support for getting alt interface number"
:::::: branch date: 8 days ago
:::::: commit date: 8 days ago
config: i386-randconfig-c021 (https://download.01.org/0day-ci/archive/20220209/202202091733.OwkhhpPA-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: Julia Lawall <julia.lawall@lip6.fr>


cocci warnings: (new ones prefixed by >>)
>> drivers/usb/gadget/function/f_tcm.c:340:2-12: alloc with no test, possible model on line 345

vim +340 drivers/usb/gadget/function/f_tcm.c

c6628548acf083 Rajnikant Bhojani 2022-01-26  331
c6628548acf083 Rajnikant Bhojani 2022-01-26  332  static int alloc_cmd_resource(struct f_uas *fu, int num, struct usb_ep *ep,
c6628548acf083 Rajnikant Bhojani 2022-01-26  333  			      void  (*complete)(struct usb_ep *ep,
c6628548acf083 Rajnikant Bhojani 2022-01-26  334  						struct usb_request *req))
c6628548acf083 Rajnikant Bhojani 2022-01-26  335  {
c6628548acf083 Rajnikant Bhojani 2022-01-26  336  	int i;
c6628548acf083 Rajnikant Bhojani 2022-01-26  337
c6628548acf083 Rajnikant Bhojani 2022-01-26  338  	fu->ncmd = num;
c6628548acf083 Rajnikant Bhojani 2022-01-26  339  	for (i = 0; i < fu->ncmd; i++) {
c6628548acf083 Rajnikant Bhojani 2022-01-26 @340  		fu->cmd[i] = kcalloc(fu->ncmd, sizeof(struct usbg_cdb),
c6628548acf083 Rajnikant Bhojani 2022-01-26  341  				GFP_KERNEL);
c6628548acf083 Rajnikant Bhojani 2022-01-26  342  		if (!fu->cmd)
c6628548acf083 Rajnikant Bhojani 2022-01-26  343  			goto err_cmd;
c6628548acf083 Rajnikant Bhojani 2022-01-26  344
c6628548acf083 Rajnikant Bhojani 2022-01-26 @345  		fu->cmd[i]->req = usb_ep_alloc_request(ep, GFP_KERNEL);
c6628548acf083 Rajnikant Bhojani 2022-01-26  346  		if (!fu->cmd[i]->req)
c6628548acf083 Rajnikant Bhojani 2022-01-26  347  			goto err_cmd;
c6628548acf083 Rajnikant Bhojani 2022-01-26  348
c6628548acf083 Rajnikant Bhojani 2022-01-26  349  		fu->cmd[i]->buf = kmalloc(fu->ep_out->maxpacket, GFP_KERNEL);
c6628548acf083 Rajnikant Bhojani 2022-01-26  350  		if (!fu->cmd[i]->buf)
c6628548acf083 Rajnikant Bhojani 2022-01-26  351  			goto err_cmd;
c6628548acf083 Rajnikant Bhojani 2022-01-26  352
c6628548acf083 Rajnikant Bhojani 2022-01-26  353  		fu->cmd[i]->req->complete = complete;
c6628548acf083 Rajnikant Bhojani 2022-01-26  354  		fu->cmd[i]->req->buf = fu->cmd[i]->buf;
c6628548acf083 Rajnikant Bhojani 2022-01-26  355  		fu->cmd[i]->req->length = fu->ep_out->maxpacket;
c6628548acf083 Rajnikant Bhojani 2022-01-26  356  		fu->cmd[i]->req->context = fu;
c6628548acf083 Rajnikant Bhojani 2022-01-26  357  	}
c6628548acf083 Rajnikant Bhojani 2022-01-26  358
c6628548acf083 Rajnikant Bhojani 2022-01-26  359  	return 0;
c6628548acf083 Rajnikant Bhojani 2022-01-26  360  err_cmd:
c6628548acf083 Rajnikant Bhojani 2022-01-26  361  	free_cmd_resource(fu, ep);
c6628548acf083 Rajnikant Bhojani 2022-01-26  362  	return -ENOMEM;
c6628548acf083 Rajnikant Bhojani 2022-01-26  363  }
c6628548acf083 Rajnikant Bhojani 2022-01-26  364

:::::: The code at line 340 was first introduced by commit
:::::: c6628548acf08392524df4bdbeee080f6f5ecc43 usb: gadget: f_tcm: queue multiple commands request

:::::: TO: Rajnikant Bhojani <rajnikant.bhojani@xilinx.com>
:::::: CC: Michal Simek <michal.simek@xilinx.com>

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

                 reply	other threads:[~2022-02-09 11:29 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=alpine.DEB.2.22.394.2202091227020.52266@hadrien \
    --to=julia.lawall@inria.fr \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=manish.narani@xilinx.com \
    --cc=monstr@monstr.eu \
    --cc=quanyang.wang@windriver.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