X-GM-THRID: 6249299693524746240 Date: Tue, 9 Feb 2016 08:34:23 -0800 (PST) From: Janani Ravichandran To: outreachy-kernel Cc: janani.rvchndrn@gmail.com Message-Id: <5c9c1fd4-25a0-4b6c-becb-e09ac2099861@googlegroups.com> In-Reply-To: <20160209162326.GC28133@kroah.com> References: <20160209210029.GA8305@janani-Inspiron-3521> <20160209162326.GC28133@kroah.com> Subject: Re: [Outreachy kernel] [PATCH v3] staging: rdma: Use kcalloc instead of kzalloc MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_449_88927440.1455035664050" X-Google-Token: EI-q6LUFqU6G6HLalL40 X-Google-IP: 72.231.208.13 ------=_Part_449_88927440.1455035664050 Content-Type: multipart/alternative; boundary="----=_Part_450_1123104877.1455035664050" ------=_Part_450_1123104877.1455035664050 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On Tuesday, 9 February 2016 11:23:28 UTC-5, gregkh wrote: > > On Tue, Feb 09, 2016 at 04:00:29PM -0500, Janani Ravichandran wrote: > > Use kcalloc rather than kzalloc when multiplied with size to prevent > > integer overflows. This change also makes code nicer to read. > > But that's not what this patch does: > > > > > Signed-off-by: Janani Ravichandran > > > --- > > Changes since v2: > > * Moved GFP_KERNEL to the previous line as it fits there. > > > > drivers/staging/rdma/hfi1/efivar.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > diff --git a/drivers/staging/rdma/hfi1/efivar.c > b/drivers/staging/rdma/hfi1/efivar.c > > index b8711f3..e569f9f 100644 > > --- a/drivers/staging/rdma/hfi1/efivar.c > > +++ b/drivers/staging/rdma/hfi1/efivar.c > > @@ -83,8 +83,7 @@ static int read_efi_var(const char *name, unsigned > long *size, > > if (!efi_enabled(EFI_RUNTIME_SERVICES)) > > return -EOPNOTSUPP; > > > > - uni_name = kcalloc(strlen(name) + 1, sizeof(efi_char16_t), > > - GFP_KERNEL); > > + uni_name = kcalloc(strlen(name) + 1, sizeof(efi_char16_t), > GFP_KERNEL); > > You aren't calling kzalloc :( > > Did you make this patch on top of something else accidentally? > Yes, Greg. That's what I seem to have done. Will send the correct one. I'm sorry. > > thanks, > > greg k-h > ------=_Part_450_1123104877.1455035664050 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable


On Tuesday, 9 February 2016 11:23:28 UTC-5, gregkh= wrote:
On Tue, Feb 09, 2016 a= t 04:00:29PM -0500, Janani Ravichandran wrote:
> Use kcalloc rather than kzalloc when multiplied with size to preve= nt
> integer overflows. This change also makes code nicer to read.

But that's not what this patch does:

>=20
> Signed-off-by: Janani Ravichandran <janani....@gmail.com>
> ---
> Changes since v2:
> =C2=A0* Moved GFP_KERNEL to the previous line as it fits there.
>=20
> =C2=A0drivers/staging/rdma/hfi1/efivar.c | 3 +--
> =C2=A01 file changed, 1 insertion(+), 2 deletions(-)
>=20
> diff --git a/drivers/staging/rdma/hfi1/efivar.c b/drivers/sta= ging/rdma/hfi1/efivar.c
> index b8711f3..e569f9f 100644
> --- a/drivers/staging/rdma/hfi1/efivar.c
> +++ b/drivers/staging/rdma/hfi1/efivar.c
> @@ -83,8 +83,7 @@ static int read_efi_var(const char *name, unsign= ed long *size,
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (!efi_ena= bled(EFI_RUNTIME_SERVICES))
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0return -EOPNOTSUPP;
> =C2=A0
> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0uni_name =3D kcal= loc(strlen(name) + 1, sizeof(efi_char16_t),
> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 =C2=A0 GFP_KERNEL);
> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0uni_name =3D kcal= loc(strlen(name) + 1, sizeof(efi_char16_t), GFP_KERNEL);

You aren't calling kzalloc :(

Did you make this patch on top of something else accidentally?
Yes, Greg. That's what I seem to have done. Will = send the correct one. I'm sorry.

thanks,

greg k-h
------=_Part_450_1123104877.1455035664050-- ------=_Part_449_88927440.1455035664050--