X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fparisc%2Fled.c;h=58e5c3e8153fde6f6d12b4020bfae8667a1b38b7;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=7d497802b906d6a18fc9b0c05ae56a562d55b1cb;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c index 7d497802b..58e5c3e81 100644 --- a/drivers/parisc/led.c +++ b/drivers/parisc/led.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include @@ -56,7 +56,7 @@ static int led_heartbeat = 1; static int led_diskio = 1; static int led_lanrxtx = 1; static char lcd_text[32]; -static char lcd_text_default[] = "Linux " UTS_RELEASE; +static char lcd_text_default[32]; #if 0 #define DPRINTK(x) printk x @@ -157,13 +157,13 @@ static int led_proc_read(char *page, char **start, off_t off, int count, static int led_proc_write(struct file *file, const char *buf, unsigned long count, void *data) { - char *cur, lbuf[count]; + char *cur, lbuf[count + 1]; int d; if (!capable(CAP_SYS_ADMIN)) return -EACCES; - memset(lbuf, 0, count); + memset(lbuf, 0, count + 1); if (copy_from_user(lbuf, buf, count)) return -EFAULT; @@ -197,7 +197,7 @@ static int led_proc_write(struct file *file, const char *buf, break; case LED_HASLCD: - while (*cur && cur[strlen(cur)-1] == '\n') + if (*cur && cur[strlen(cur)-1] == '\n') cur[strlen(cur)-1] = 0; if (*cur == 0) cur = lcd_text_default; @@ -676,6 +676,9 @@ int __init led_init(void) struct pdc_chassis_info chassis_info; int ret; + snprintf(lcd_text_default, sizeof(lcd_text_default), + "Linux %s", system_utsname.release); + /* Work around the buggy PDC of KittyHawk-machines */ switch (CPU_HVERSION) { case 0x580: /* KittyHawk DC2-100 (K100) */