Fixes the below issue:
- check if pointer t is null before de-referencing
diff --git a/gpio.c b/gpio.c
index 39480b0..5db17e7 100644
--- a/gpio.c
+++ b/gpio.c
@@ -273,9 +273,11 @@ static int gpio_display(bool refresh)
static int gpio_change(int keyvalue)
{
struct tree *t = display_get_row_data(GPIO);
- struct gpio_info *gpio = t->private;
+ if (!t)
+ return -1;
- if (!t || !gpio)
+ struct gpio_info *gpio = t->private;
+ if (!gpio)
return -1;
switch (keyvalue) {
--
Thanks,
Salman Ahmed
_______________________________________________
linaro-dev mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/linaro-dev