* [xlnx:xlnx_rebase_v5.4 892/1683] drivers/usb/gadget/function/f_tcm.c:342 alloc_cmd_resource() warn: this array is probably non-NULL. 'fu->cmd'
@ 2020-10-30 7:56 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2020-10-30 7:56 UTC (permalink / raw)
To: kbuild, Rajnikant Bhojani
Cc: Michal Simek, kbuild-all, lkp, Piyush Mehta, linux-arm-kernel,
Dan Carpenter
[-- Attachment #1: Type: text/plain, Size: 3214 bytes --]
tree: https://github.com/Xilinx/linux-xlnx xlnx_rebase_v5.4
head: 87d2d58e2137748748d96a630fd93eb0e2d81123
commit: 940136294318baeb0fa1e20b56243cd6a7b9c846 [892/1683] usb: gadget: f_tcm: queue multiple commands request
config: x86_64-randconfig-m001-20201029 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 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:
drivers/usb/gadget/function/f_tcm.c:342 alloc_cmd_resource() warn: this array is probably non-NULL. 'fu->cmd'
vim +342 drivers/usb/gadget/function/f_tcm.c
940136294318bae Rajnikant Bhojani 2020-01-23 332 static int alloc_cmd_resource(struct f_uas *fu, int num, struct usb_ep *ep,
940136294318bae Rajnikant Bhojani 2020-01-23 333 void (*complete)(struct usb_ep *ep,
940136294318bae Rajnikant Bhojani 2020-01-23 334 struct usb_request *req))
940136294318bae Rajnikant Bhojani 2020-01-23 335 {
940136294318bae Rajnikant Bhojani 2020-01-23 336 int i;
940136294318bae Rajnikant Bhojani 2020-01-23 337
940136294318bae Rajnikant Bhojani 2020-01-23 338 fu->ncmd = num;
940136294318bae Rajnikant Bhojani 2020-01-23 339 for (i = 0; i < fu->ncmd; i++) {
940136294318bae Rajnikant Bhojani 2020-01-23 340 fu->cmd[i] = kcalloc(fu->ncmd, sizeof(struct usbg_cdb),
940136294318bae Rajnikant Bhojani 2020-01-23 341 GFP_KERNEL);
940136294318bae Rajnikant Bhojani 2020-01-23 @342 if (!fu->cmd)
This should be "if (!fu->cmd[i])"
940136294318bae Rajnikant Bhojani 2020-01-23 343 goto err_cmd;
940136294318bae Rajnikant Bhojani 2020-01-23 344
940136294318bae Rajnikant Bhojani 2020-01-23 345 fu->cmd[i]->req = usb_ep_alloc_request(ep, GFP_KERNEL);
940136294318bae Rajnikant Bhojani 2020-01-23 346 if (!fu->cmd[i]->req)
940136294318bae Rajnikant Bhojani 2020-01-23 347 goto err_cmd;
940136294318bae Rajnikant Bhojani 2020-01-23 348
940136294318bae Rajnikant Bhojani 2020-01-23 349 fu->cmd[i]->buf = kmalloc(fu->ep_out->maxpacket, GFP_KERNEL);
940136294318bae Rajnikant Bhojani 2020-01-23 350 if (!fu->cmd[i]->buf)
940136294318bae Rajnikant Bhojani 2020-01-23 351 goto err_cmd;
940136294318bae Rajnikant Bhojani 2020-01-23 352
940136294318bae Rajnikant Bhojani 2020-01-23 353 fu->cmd[i]->req->complete = complete;
940136294318bae Rajnikant Bhojani 2020-01-23 354 fu->cmd[i]->req->buf = fu->cmd[i]->buf;
940136294318bae Rajnikant Bhojani 2020-01-23 355 fu->cmd[i]->req->length = fu->ep_out->maxpacket;
940136294318bae Rajnikant Bhojani 2020-01-23 356 fu->cmd[i]->req->context = fu;
940136294318bae Rajnikant Bhojani 2020-01-23 357 }
940136294318bae Rajnikant Bhojani 2020-01-23 358
940136294318bae Rajnikant Bhojani 2020-01-23 359 return 0;
940136294318bae Rajnikant Bhojani 2020-01-23 360 err_cmd:
940136294318bae Rajnikant Bhojani 2020-01-23 361 free_cmd_resource(fu, ep);
940136294318bae Rajnikant Bhojani 2020-01-23 362 return -ENOMEM;
940136294318bae Rajnikant Bhojani 2020-01-23 363 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 32941 bytes --]
[-- Attachment #3: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-10-30 7:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-30 7:56 [xlnx:xlnx_rebase_v5.4 892/1683] drivers/usb/gadget/function/f_tcm.c:342 alloc_cmd_resource() warn: this array is probably non-NULL. 'fu->cmd' 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).