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]
Date:   Wed, 20 Sep 2017 07:49:02 -0700
From:   Viresh Kumar <viresh.kumar@...aro.org>
To:     Joe Perches <joe@...ches.com>
Cc:     Arvind Yadav <arvind.yadav.cs@...il.com>, vireshk@...nel.org,
        nm@...com, sboyd@...eaurora.org, rjw@...ysocki.net, pavel@....cz,
        len.brown@...el.com, gregkh@...uxfoundation.org,
        linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] PM / OPP: Handle return value of kasprintf

On 20-09-17, 04:17, Joe Perches wrote:
> On Wed, 2017-09-20 at 12:29 +0530, Arvind Yadav wrote:
> > kasprintf() can fail here and we must check its return value.
> []
> > diff --git a/drivers/base/power/opp/debugfs.c b/drivers/base/power/opp/debugfs.c
> []
> > @@ -45,7 +45,8 @@ static bool opp_debug_create_supplies(struct dev_pm_opp *opp,
> >  
> >  	for (i = 0; i < opp_table->regulator_count; i++) {
> >  		name = kasprintf(GFP_KERNEL, "supply-%d", i);
> > -
> > +		if (!name)
> > +			return false;
> >  		/* Create per-opp directory */
> >  		d = debugfs_create_dir(name, pdentry);
> 
> Probably more sensible to avoid the kasprintf/kfree
> and just have
> 	char name[20];
> on the stack

Sure.

@Arvind: I will let you write that patch.

-- 
viresh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ