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] [day] [month] [year] [list]
Message-ID: <20130618102325.GA2594@localhost>
Date:	Tue, 18 Jun 2013 12:23:25 +0200
From:	Johan Hovold <jhovold@...il.com>
To:	Greg KH <gregkh@...uxfoundation.org>
Cc:	Johan Hovold <jhovold@...il.com>,
	Tobias Winter <tobias@...uxdingsda.de>,
	Bjørn Mork <bjorn@...k.no>,
	Rob Landley <rob@...dley.net>, linux-usb@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 2/3] USB: serial: make minor allocation dynamic

> > > @@ -123,8 +116,9 @@ static void return_serial(struct usb_ser
> > >  
> > >  	mutex_lock(&table_lock);
> > >  	for (i = 0; i < serial->num_ports; ++i)
> > > -		serial_table[serial->minor + i] = NULL;
> > > +		idr_remove(&serial_minors, serial->port[i]->minor);
> > >  	mutex_unlock(&table_lock);
> > > +	serial->minors_reserved = 0;
> > 
> > This isn't strictly needed as the serial struct release_serial is only
> > called once when the struct is about to be freed.
> 
> Really?  Why were we doing this type of thing before with the "not
> allocated" flag?  It seems that we were protecting some path that I
> can't remember at the moment.  So to be safe, I'll leave it for now...

It was and is only used when releasing the serial struct to check
whether minors had been allocated or not at probe and if return_serial
(release_minors) should be called. This in done in destroy_serial just
before freeing the struct, so clearing the flag is redundant, but
doesn't hurt anyone, I guess. ;)

Johan
--
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