Revert "gpio: prevent potential speculation leaks in gpio_device_get_desc()"
This reverts commit fc35a684e9
.
This commit is contained in:
parent
31101efbb8
commit
147ce5e81c
1 changed files with 1 additions and 2 deletions
|
@ -4,7 +4,6 @@
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
#include <linux/irq.h>
|
#include <linux/irq.h>
|
||||||
#include <linux/nospec.h>
|
|
||||||
#include <linux/spinlock.h>
|
#include <linux/spinlock.h>
|
||||||
#include <linux/list.h>
|
#include <linux/list.h>
|
||||||
#include <linux/device.h>
|
#include <linux/device.h>
|
||||||
|
@ -148,7 +147,7 @@ struct gpio_desc *gpiochip_get_desc(struct gpio_chip *gc,
|
||||||
if (hwnum >= gdev->ngpio)
|
if (hwnum >= gdev->ngpio)
|
||||||
return ERR_PTR(-EINVAL);
|
return ERR_PTR(-EINVAL);
|
||||||
|
|
||||||
return &gdev->descs[array_index_nospec(hwnum, gdev->ngpio)];
|
return &gdev->descs[hwnum];
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(gpiochip_get_desc);
|
EXPORT_SYMBOL_GPL(gpiochip_get_desc);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue