History log of /drivers/leds/leds-gpio-register.c
Revision Date Author Comments
a823e76138466225d0a9f45520c5654132939a01 28-Sep-2014 Xiubo Li <Li.Xiubo@freescale.com> led: gpio: Fix possible ZERO_SIZE_PTR pointer dereferencing error.

Since we cannot make sure the 'pdata->num_leds' will always be none
zero here, and then if it equals to zero, the kmemdup() will return
ZERO_SIZE_PTR, which equals to ((void *)16).

So this patch fix this with just doing the zero check before calling
kmemdup().

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
4cc72346f05ef549403d997d66fd517109e59d24 28-Sep-2014 Xiubo Li <Li.Xiubo@freescale.com> led: gpio: Sort include headers alphabetically

If the inlcude headers aren't sorted alphabetically, then the
logical choice is to append new ones, however that creates a
lot of potential for conflicts or duplicates because every change
will then add new includes in the same location.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
4440673a95e63ad888a41db596edaa0c55d3a332 25-May-2011 Uwe Kleine-König <u.kleine-koenig@pengutronix.de> leds: provide helper to register "leds-gpio" devices

This function makes a deep copy of the platform data to allow it to live
in init memory. For a kernel that supports several machines and so
includes the definition for several leds-gpio devices this saves quite
some memory because all but one definition can be free'd after boot.

As the function is used by arch code it must be builtin and so cannot go
into leds-gpio.c.

[akpm@linux-foundation.org: s/CONFIG_LED_REGISTER_GPIO/CONFIG_LEDS_REGISTER_GPIO/]
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Russell King <rmk@arm.linux.org.uk>
Acked-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: H Hartley Sweeten <hartleys@visionengravers.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>