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]
Date:   Tue, 15 May 2018 14:46:23 +0100
From:   Eric Anholt <eric@...olt.net>
To:     Dan Carpenter <dan.carpenter@...cle.com>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
        linux-rpi-kernel@...ts.infradead.org,
        Stefan Wahren <stefan.wahren@...e.com>
Subject: Re: [PATCH] staging: bcm2835-camera: Replace open-coded idr with a struct idr.

Dan Carpenter <dan.carpenter@...cle.com> writes:

> On Thu, May 10, 2018 at 04:31:07PM -0700, Eric Anholt wrote:
>> @@ -258,32 +181,40 @@ get_msg_context(struct vchiq_mmal_instance *instance)
>>  	if (!msg_context)
>>  		return ERR_PTR(-ENOMEM);
>>  
>> -	msg_context->instance = instance;
>> -	msg_context->handle =
>> -		mmal_context_map_create_handle(&instance->context_map,
>> -					       msg_context,
>> -					       GFP_KERNEL);
>> +	/* Create an ID that will be passed along with our message so
>> +	 * that when we service the VCHI reply, we can look up what
>> +	 * message is being replied to.
>> +	 */
>> +	spin_lock(&instance->context_map_lock);
>> +	handle = idr_alloc(&instance->context_map, msg_context,
>> +			   0, 0, GFP_KERNEL);
>> +	spin_unlock(&instance->context_map_lock);
>>  
>> -	if (!msg_context->handle) {
>> +	if (msg_context->handle < 0) {
>
> This should probably be testing:
>
> 	if (handle < 0) {

That's what Stefan said and was fixed in v2 already.

Download attachment "signature.asc" of type "application/pgp-signature" (833 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ