Browse Source

[PATCH] fbdev: make pxafb more robust to errors with CONFIG_FB_PXA_PARAMETERS

pxafb.c runs into an oops if CONFIG_FB_PXA_PARAMETERS is enabled and no
parameters are set in command line.  The following patch avoids this
problem.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Ole Reinhardt 19 years ago
parent
commit
fb79ffa4dd
1 changed files with 2 additions and 1 deletions
  1. 2 1
      drivers/video/pxafb.c

+ 2 - 1
drivers/video/pxafb.c

@@ -1396,7 +1396,8 @@ static struct platform_driver pxafb_driver = {
 int __devinit pxafb_setup(char *options)
 int __devinit pxafb_setup(char *options)
 {
 {
 # ifdef CONFIG_FB_PXA_PARAMETERS
 # ifdef CONFIG_FB_PXA_PARAMETERS
-	strlcpy(g_options, options, sizeof(g_options));
+	if (options)
+		strlcpy(g_options, options, sizeof(g_options));
 # endif
 # endif
 	return 0;
 	return 0;
 }
 }