lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160720154756.GC1688@katana>
Date:	Wed, 20 Jul 2016 17:47:56 +0200
From:	Wolfram Sang <wsa@...-dreams.de>
To:	Julia Lawall <julia.lawall@...6.fr>
Cc:	SF Markus Elfring <elfring@...rs.sourceforge.net>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	devel@...verdev.osuosl.org, LKML <linux-kernel@...r.kernel.org>,
	kernel-janitors@...r.kernel.org
Subject: Re: [PATCH 3/9] staging: ks7010: Return directly after a failed
 kmalloc()

On Sun, Jul 17, 2016 at 08:58:14PM +0200, Julia Lawall wrote:
> 
> 
> On Sun, 17 Jul 2016, SF Markus Elfring wrote:
> 
> > From: Markus Elfring <elfring@...rs.sourceforge.net>
> > Date: Sun, 17 Jul 2016 15:55:02 +0200
> >
> > Return directly after a memory allocation failed at the beginning.
> >
> > Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
> > ---
> >  drivers/staging/ks7010/ks7010_sdio.c | 19 +++++++------------
> >  1 file changed, 7 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
> > index 3622fba..9b954cb 100644
> > --- a/drivers/staging/ks7010/ks7010_sdio.c
> > +++ b/drivers/staging/ks7010/ks7010_sdio.c
> > @@ -713,10 +713,8 @@ static int ks7010_sdio_update_index(struct ks_wlan_private *priv, u32 index)
> >  	unsigned char *data_buf;
> >
> >  	data_buf = kmalloc(sizeof(u32), GFP_KERNEL);
> > -	if (!data_buf) {
> > -		rc = 1;
> > -		goto error_out;
> > -	}
> > +	if (!data_buf)
> > +		return 1;
> 
> One could rather wonder why the function has such strange error values...

Agreed. Markus, can you check if we can use -ENOMEM in those places.


Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ