Re: [PATCH] leds-pca955x: Add proper error handling and fix bogusmemory handling

From: Nate Case
Date: Thu Aug 07 2008 - 18:59:26 EST


On Fri, 2008-08-08 at 00:45 +0200, Sven Wegener wrote:
> Check the return value of led_classdev_register and unregister all
> registered
> devices, if registering one device fails. Also the dynamic memory
> handling is
> totally bogus. You can't allocate multiple chunks via kzalloc() and
> expect
> them to be in order later. I wonder how this ever worked.

Yikes. Good catch. To be honest, I developed this for an embedded
system where it was always built into the kernel. So the
pca955x_remove() case never would have been tested. The assumption
about the chunks being in order probably came from a cut-and-paste from
another driver.

I'll test your patch and also build it as a module to make sure
unloading works properly. Thanks.

--
Nate Case <ncase@xxxxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/