summaryrefslogtreecommitdiff
path: root/drivers/gpio/tegra2_gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio/tegra2_gpio.c')
-rw-r--r--drivers/gpio/tegra2_gpio.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpio/tegra2_gpio.c b/drivers/gpio/tegra2_gpio.c
index f686e80..22669b6 100644
--- a/drivers/gpio/tegra2_gpio.c
+++ b/drivers/gpio/tegra2_gpio.c
@@ -146,8 +146,10 @@ int gpio_request(int gp, const char *label)
if (gp >= MAX_NUM_GPIOS)
return -1;
- strncpy(gpio_names[gp].name, label, GPIO_NAME_SIZE);
- gpio_names[gp].name[GPIO_NAME_SIZE - 1] = '\0';
+ if (label != NULL) {
+ strncpy(gpio_names[gp].name, label, GPIO_NAME_SIZE);
+ gpio_names[gp].name[GPIO_NAME_SIZE - 1] = '\0';
+ }
/* Configure as a GPIO */
set_config(gp, 1);