aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-gpio-register.c
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2014-11-26 09:41:09 +0100
committerThierry Reding <treding@nvidia.com>2014-11-26 09:42:11 +0100
commit7f06dd61248a75668bbb39b6fcca6ff407745df8 (patch)
tree30cefbd6f503d20557e24a1765a027687170a7da /drivers/leds/leds-gpio-register.c
parentLinux 3.18-rc1 (diff)
parentpowerpc/iommu: Rename iommu_[un]map_sg functions (diff)
downloadlinux-dev-7f06dd61248a75668bbb39b6fcca6ff407745df8.tar.xz
linux-dev-7f06dd61248a75668bbb39b6fcca6ff407745df8.zip
Merge branch 'core' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
This branch contains a couple of changes that will conflict with the Tegra SMMU driver rewrite. Since the driver is largely rewritten the conflict resolution is non-trivial.
Diffstat (limited to 'drivers/leds/leds-gpio-register.c')
-rw-r--r--drivers/leds/leds-gpio-register.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/leds/leds-gpio-register.c b/drivers/leds/leds-gpio-register.c
index 1c4ed5510f35..75717ba68ae0 100644
--- a/drivers/leds/leds-gpio-register.c
+++ b/drivers/leds/leds-gpio-register.c
@@ -7,9 +7,9 @@
* Free Software Foundation.
*/
#include <linux/err.h>
+#include <linux/leds.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
-#include <linux/leds.h>
/**
* gpio_led_register_device - register a gpio-led device
@@ -28,6 +28,9 @@ struct platform_device *__init gpio_led_register_device(
struct platform_device *ret;
struct gpio_led_platform_data _pdata = *pdata;
+ if (!pdata->num_leds)
+ return ERR_PTR(-EINVAL);
+
_pdata.leds = kmemdup(pdata->leds,
pdata->num_leds * sizeof(*pdata->leds), GFP_KERNEL);
if (!_pdata.leds)