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: <alpine.DEB.2.02.1506211222350.2047@localhost6.localdomain6>
Date:	Sun, 21 Jun 2015 12:29:12 +0200 (CEST)
From:	Julia Lawall <julia.lawall@...6.fr>
To:	walter harms <wharms@....de>
cc:	Julia Lawall <Julia.Lawall@...6.fr>,
	Oleg Drokin <oleg.drokin@...el.com>,
	kernel-janitors@...r.kernel.org,
	Andreas Dilger <andreas.dilger@...el.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	HPDD-discuss@...1.01.org, devel@...verdev.osuosl.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 09/12] staging: lustre: obdclass: Use !x to check for
 kzalloc failure

> > @@ -885,7 +885,7 @@ static int lmd_parse_mgssec(struct lustr
> >  		length = tail - ptr;
> >  
> >  	lmd->lmd_mgssec = kzalloc(length + 1, GFP_NOFS);
> > -	if (lmd->lmd_mgssec == NULL)
> > +	if (!lmd->lmd_mgssec)
> >  		return -ENOMEM;
> >  
> >  	memcpy(lmd->lmd_mgssec, ptr, length);
> looks like memdup()

kmemdup has the same length for both calls.  There is kstrndup, but it
recalculates the length, which looks unnecessary here.

julia
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ