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:   Mon, 28 Mar 2022 13:49:48 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Wolfram Sang <wsa+renesas@...g-engineering.com>,
        linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-renesas-soc@...r.kernel.org
Subject: Re: [PATCH v7 1/1] gpio: add sloppy logic analyzer using polling

On Mon, Mar 28, 2022 at 11:37:32AM +0200, Wolfram Sang wrote:

> > > +	mutex_lock(&priv->lock);
> > > +
> > > +	vfree(priv->blob.data);
> > 
> > 	priv->blob.data = NULL;
> > 	priv->blob.size = 0;
> > 
> > > +	p = vzalloc(val);
> > > +	if (!p) {
> > > +		val = 0;
> > > +		ret = -ENOMEM;
> > > +	}
> > 
> > 	p = vzalloc(val);
> > 	if (!p)
> > 		return -ENOMEM;
> > 
> > > +	priv->blob.data = p;
> > > +	priv->blob.size = val;
> 
> I don't like assigning 'priv' memebers twice, so I'd like to keep it as
> is.

But this will give better understanding of the steps the code performs, no?
(Because this function basically contains two steps at once. I assume it's
 done this way due to absence of vrealloc(), right?)

But we have kvrealloc(). Can it be used here?

...

> > Can it be wrapped by DEFINE_SHOW_ATTRIBUTE()?
> 
> I don't see a way. Do you?

Me neither. I mixed this up with (not upstreamed yet) DEFINE_STORE_ATTRIBUTE.

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ