Re: [PATCH] leds: leds-nic78bx: handle error checking and error processing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

> From: chenqiwu <chenqiwu@xxxxxxxxxx>
> 
> Add error checking and error processing for led probe.

led->LED please.

Ok, I see that error handling there is clearly propblematic.

> Signed-off-by: chenqiwu <chenqiwu@xxxxxxxxxx>

> 
> +
> +err_led_classdev_register:
> +	i -= 1;
> +	while (i >= 0)
> +		devm_led_classdev_unregister(dev, &nic78bx_leds[i--].cdev);
> +	devm_release_region(dev, io_rc->start, resource_size(io_rc));
> +err_request_region:
> +err_res_size:
> +	release_resource(io_rc);
> +err_get_res:
> +	devm_kfree(dev, led_data);
>  	return ret;

But we should not need to do devm_ releasing in the error paths,
right? Core is expected to do that for us... AFAICT only
release_resource() is neccessary... unless it has some kind of devm_
variant.

Best regards,
									Pavel
									
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux