crypto/acompress.c:616:8-15: WARNING opportunity for kmemdup
kernel test robot
build bottree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 2c9c612abeb38aab0e87d48496de6fd6daafb00b commit: 097c432caaa6d91f87732fe991cb08139e31101a [4012/5419] crypto: acomp - Add ACOMP_REQUEST_CLONE config: nios2-randconfig-r054-20250422 (https://download.01.org/0day-ci/archive/20250423/[email protected]/config) compiler: nios2-linux-gcc (GCC) 13.3.0
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
cocci warnings: (new ones prefixed by >>)
>> crypto/acompress.c:616:8-15: WARNING opportunity for kmemdup
vim +616 crypto/acompress.c
609
610 struct acomp_req *acomp_request_clone(struct acomp_req *req,
611 size_t total, gfp_t gfp)
612 {
613 struct crypto_acomp *tfm = crypto_acomp_reqtfm(req);
614 struct acomp_req *nreq;
615
> 616 nreq = kmalloc(total, gfp);
617 if (!nreq) {
618 acomp_request_set_tfm(req, tfm->fb);
619 req->base.flags = CRYPTO_TFM_REQ_ON_STACK;
620 return req;
621 }
622
623 memcpy(nreq, req, total);
624 acomp_request_set_tfm(req, tfm);
625 return req;
626 }
627 EXPORT_SYMBOL_GPL(acomp_request_clone);
628
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki