summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-syscon.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-12-02 10:54:03 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2015-12-02 10:54:03 -0800
commit79e63f50c2c7da8333defccf273ba45578573472 (patch)
tree4c76b1a5ad66f7ddd6c4e6c208455cfd6e07b950 /drivers/gpio/gpio-syscon.c
parent6a24e72d23a6a223687274a6cf61a01940a7d7c9 (diff)
parent000255b7dfc3119c13f388f179d6fc19cd00eada (diff)
Merge tag 'gpio-v4.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio
Pull GPIO fixes from Linus Walleij: "Some GPIO fixes for the v4.4 series: - Fix a bunch of possible NULL references found by Coccinelle jockeys. - Stop creating Tegra's debugfs on everything and its dog. This is an ARM multiplatform kernel issue. - Fix an oops in gpiolib for NULL names on named GPIOs. - Fix a complex OMAP1 bug in the OMAP driver" * tag 'gpio-v4.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: gpio: omap: drop omap1 mpuio specific irq_mask/unmask callbacks gpiolib: fix oops, if gpio name is NULL gpio-tegra: Do not create the debugfs entry by default gpio: palmas: fix a possible NULL dereference gpio: syscon: fix a possible NULL dereference gpio: 74xx: fix a possible NULL dereference
Diffstat (limited to 'drivers/gpio/gpio-syscon.c')
-rw-r--r--drivers/gpio/gpio-syscon.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-syscon.c b/drivers/gpio/gpio-syscon.c
index 045a952576c7..7b25fdf64802 100644
--- a/drivers/gpio/gpio-syscon.c
+++ b/drivers/gpio/gpio-syscon.c
@@ -187,11 +187,15 @@ MODULE_DEVICE_TABLE(of, syscon_gpio_ids);
static int syscon_gpio_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
- const struct of_device_id *of_id = of_match_device(syscon_gpio_ids, dev);
+ const struct of_device_id *of_id;
struct syscon_gpio_priv *priv;
struct device_node *np = dev->of_node;
int ret;
+ of_id = of_match_device(syscon_gpio_ids, dev);
+ if (!of_id)
+ return -ENODEV;
+
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;