Revert "gpio: prevent potential speculation leaks in gpio_device_get_desc()"

This reverts commit fc35a684e9.
This commit is contained in:
Ksawlii 2024-11-24 00:23:32 +01:00
parent 31101efbb8
commit 147ce5e81c

View file

@ -4,7 +4,6 @@
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/nospec.h>
#include <linux/spinlock.h>
#include <linux/list.h>
#include <linux/device.h>
@ -148,7 +147,7 @@ struct gpio_desc *gpiochip_get_desc(struct gpio_chip *gc,
if (hwnum >= gdev->ngpio)
return ERR_PTR(-EINVAL);
return &gdev->descs[array_index_nospec(hwnum, gdev->ngpio)];
return &gdev->descs[hwnum];
}
EXPORT_SYMBOL_GPL(gpiochip_get_desc);