diff options
Diffstat (limited to 'drivers/gpio/tegra2_gpio.c')
| -rw-r--r-- | drivers/gpio/tegra2_gpio.c | 6 | 
1 files changed, 4 insertions, 2 deletions
| diff --git a/drivers/gpio/tegra2_gpio.c b/drivers/gpio/tegra2_gpio.c index f686e8063..22669b616 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); |