Re: [PATCH v2] gpio: ath79: Fix potential NULL dereference in ath79_gpio_probe()

2018-03-27 Thread Linus Walleij
On Sun, Mar 25, 2018 at 12:40 AM, Alban Bedel wrote: > From: Wei Yongjun > > platform_get_resource() may return NULL, add proper > check to avoid potential NULL dereferencing. > > This is detected by Coccinelle semantic patch. > > @@ > expression pdev, res, n, t, e, e1, e2; > @@ > > res = platfo

[PATCH v2] gpio: ath79: Fix potential NULL dereference in ath79_gpio_probe()

2018-03-24 Thread Alban Bedel
From: Wei Yongjun platform_get_resource() may return NULL, add proper check to avoid potential NULL dereferencing. This is detected by Coccinelle semantic patch. @@ expression pdev, res, n, t, e, e1, e2; @@ res = platform_get_resource(pdev, t, n); + if (!res) + return -EINVAL; ... when != re