Search Linux Wireless

[RFC PATCH 1/2] net: rfkill: gpio: Fix NULL pointer deference

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Carlo Caione <carlo@xxxxxxxxxxxx>

In the rfkill_gpio code the variable type_name is not initialized and it
can point to a spurious memory location. When
device_property_read_string is not able to locate the string we are
passing to rfkill_find_type this random pointer, causing a NULL pointer
dereference when using strcmp.

Signed-off-by: Carlo Caione <carlo@xxxxxxxxxxxx>
---
 net/rfkill/rfkill-gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c
index 41bd496531d4..659d2edae972 100644
--- a/net/rfkill/rfkill-gpio.c
+++ b/net/rfkill/rfkill-gpio.c
@@ -88,7 +88,7 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
 {
 	struct rfkill_gpio_data *rfkill;
 	struct gpio_desc *gpio;
-	const char *type_name;
+	const char *type_name = NULL;
 	int ret;
 
 	rfkill = devm_kzalloc(&pdev->dev, sizeof(*rfkill), GFP_KERNEL);
-- 
2.14.1




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux