From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============2902749218867139388==" MIME-Version: 1.0 From: Namjae Jeon To: kbuild-all@lists.01.org Subject: Re: [PATCH] cifsd: fix memdup.cocci warnings Date: Fri, 02 Apr 2021 12:21:07 +0900 Message-ID: <00a201d7276f$38ce5b60$aa6b1220$@samsung.com> In-Reply-To: <20210401210048.GA8559@9f101362a1e3> List-Id: --===============2902749218867139388== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi, I will apply it. Thanks for your patch. > = > From: kernel test robot > = > fs/cifsd/smb2pdu.c:1177:27-34: WARNING opportunity for kmemdup > = > Use kmemdup rather than duplicating its implementation > = > Generated by: scripts/coccinelle/api/memdup.cocci > = > Fixes: 5dfeb6d945e5 ("cifsd: use kmalloc() for small allocations") > Reported-by: kernel test robot > Signed-off-by: kernel test robot > --- > = > tree: git://github.com/smfrench/smb3-kernel.git pr/35 > head: 4be6ba679c5175935a9132b87148d215a69cec16 > commit: 5dfeb6d945e5548e5fc31f2188aaa90467b4d55d [28/35] cifsd: use kmall= oc() for small allocations > = > smb2pdu.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > = > --- a/fs/cifsd/smb2pdu.c > +++ b/fs/cifsd/smb2pdu.c > @@ -1174,13 +1174,11 @@ static int alloc_preauth_hash(struct ksm > if (sess->Preauth_HashValue) > return 0; > = > - sess->Preauth_HashValue =3D kmalloc(PREAUTH_HASHVALUE_SIZE, GFP_KERNEL); > + sess->Preauth_HashValue =3D kmemdup(conn->preauth_info->Preauth_HashVal= ue, > + PREAUTH_HASHVALUE_SIZE, GFP_KERNEL); > if (!sess->Preauth_HashValue) > return -ENOMEM; > = > - memcpy(sess->Preauth_HashValue, > - conn->preauth_info->Preauth_HashValue, > - PREAUTH_HASHVALUE_SIZE); > return 0; > } >=20 --===============2902749218867139388==--