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: <20130203121809.2fb21a0c@stein>
Date:	Sun, 3 Feb 2013 12:18:09 +0100
From:	Stefan Richter <stefanr@...6.in-berlin.de>
To:	Tejun Heo <tj@...nel.org>
Cc:	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
	rusty@...tcorp.com.au, bfields@...ldses.org,
	skinsbursky@...allels.com, ebiederm@...ssion.com,
	jmorris@...ei.org, axboe@...nel.dk,
	linux1394-devel@...ts.sourceforge.net
Subject: Re: [PATCH 13/62] firewire: convert to idr_alloc()

On Feb 03 Stefan Richter wrote:
> On Feb 02 Tejun Heo wrote:
> > --- a/drivers/firewire/core-device.c
> > +++ b/drivers/firewire/core-device.c
> > @@ -1017,13 +1017,12 @@ static void fw_device_init(struct work_struct *work)
> >  
> >  	fw_device_get(device);
> >  	down_write(&fw_device_rwsem);
> > -	ret = idr_pre_get(&fw_device_idr, GFP_KERNEL) ?
> > -	      idr_get_new(&fw_device_idr, device, &minor) :
> > -	      -ENOMEM;
> > +	ret = idr_alloc(&fw_device_idr, device, 0, 0, GFP_KERNEL);
> >  	up_write(&fw_device_rwsem);
> >  
> >  	if (ret < 0)
> >  		goto error;
> > +	minor = ret;
> >  
> >  	device->device.bus = &fw_bus_type;
> >  	device->device.type = &fw_device_type;
> 
> This hunk is OK, of course.

Could be changed into

	ret = idr_alloc(&fw_device_idr, device, 0, 1 << MINORBITS, GFP_KERNEL);

though, which would be an additional bug fix.
-- 
Stefan Richter
-=====-===-= --=- ---==
http://arcgraph.de/sr/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ