mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-17 10:26:09 +00:00
gpio: rtd: Fix signedness bug in probe
The "data->irqs[]" array holds unsigned int so this error handling will not work correctly. Fixes: eee636bff0dc ("gpio: rtd: Add support for Realtek DHC(Digital Home Center) RTD SoCs") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
parent
576db73424
commit
c8fb5a52b9
@ -525,18 +525,21 @@ static int rtd_gpio_probe(struct platform_device *pdev)
|
|||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
struct gpio_irq_chip *irq_chip;
|
struct gpio_irq_chip *irq_chip;
|
||||||
struct rtd_gpio *data;
|
struct rtd_gpio *data;
|
||||||
|
int ret;
|
||||||
|
|
||||||
data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
|
data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
|
||||||
if (!data)
|
if (!data)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
data->irqs[0] = platform_get_irq(pdev, 0);
|
ret = platform_get_irq(pdev, 0);
|
||||||
if (data->irqs[0] < 0)
|
if (ret < 0)
|
||||||
return data->irqs[0];
|
return ret;
|
||||||
|
data->irqs[0] = ret;
|
||||||
|
|
||||||
data->irqs[1] = platform_get_irq(pdev, 1);
|
ret = platform_get_irq(pdev, 1);
|
||||||
if (data->irqs[1] < 0)
|
if (ret < 0)
|
||||||
return data->irqs[1];
|
return ret;
|
||||||
|
data->irqs[1] = ret;
|
||||||
|
|
||||||
data->info = device_get_match_data(dev);
|
data->info = device_get_match_data(dev);
|
||||||
if (!data->info)
|
if (!data->info)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user