OMAP: DSS2: OMAPFB: Fix null pointer check
PATCH 1/1 OMAP: DSS2: OMAPFB: Fix null pointer check
A null pointer check added.
--- drivers/video/omap2/omapfb/omapfb-main.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/video/omap2/omapfb/omapfb-main.c +2 -0
@@ -2133,6 +2133,8 @@ static int omapfb_parse_def_modes(struct omapfb2_device *fbdev)int r =0 ; str =kmalloc (strlen (def_mode) +1 ,GFP_KERNEL ); +if (str ==NULL ) +return -EINVAL ;strcpy (str, def_mode); options = str;
Signature · 1 line
1.5.6.3
Quoted 12 lines · Samreen
A null pointer check added.
Signed-off-by Samreen <[email protected]>---
drivers/video/omap2/omapfb/omapfb-main.c | 2 ++1 files changed, 2 insertions(+), 0 deletions(-)drivers/video/omap2/omapfb/omapfb-main.c +0
-0
drivers/video/omap2/omapfb/omapfb-main.c static int omapfb_parse_def_modes(struct omapfb2_device *fbdev) · line 2137
Quoted 5 lines
drivers/video/omap2/omapfb/omapfb-main.c +2
-0@@ -2133,6 +2133,8 @@ static int omapfb_parse_def_modes(struct omapfb2_device *fbdev) int r = 0; str = kmalloc(strlen(def_mode) + 1, GFP_KERNEL); + if (str = NULL) + return -EINVAL;
Shouldn't be rerutn _ENNOMEM; instead to get correct error code?
Quoted 11 lines
drivers/video/omap2/omapfb/omapfb-main.c +0
-1strcpy(str, def_mode); options = str; --1.5.6.3
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
thank,
marek
Signature · 10 lines
as simple and primitive as possible ------------------------------------------------- Marek Belisko - OPEN-NANDRA Freelance Developer Ruska Nova Ves 219 | Presov, 08005 Slovak Republic Tel: +421 915 052 184 skype: marekwhite icq: 290551086 web: http://open-nandra.com
Quoted 12 lines · ext Samreen
A null pointer check added.
Signed-off-by Samreen <[email protected]>--- drivers/video/omap2/omapfb/omapfb-main.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)drivers/video/omap2/omapfb/omapfb-main.c +0
-0
drivers/video/omap2/omapfb/omapfb-main.c static int omapfb_parse_def_modes(struct omapfb2_device *fbdev) · line 2138
Quoted 6 lines
drivers/video/omap2/omapfb/omapfb-main.c +2
-0@@ -2133,6 +2133,8 @@ static int omapfb_parse_def_modes(struct omapfb2_device *fbdev)int r =0 ; str =kmalloc (strlen (def_mode) +1 ,GFP_KERNEL ); +if (str =NULL ) +return -EINVAL ;strcpy (str, def_mode);
While you're at it you could change the code to use kstrdup().
Signature · 1 line
Ville Syrjälä
Quoted 16 lines · Belisko Marek
Quoted 15 lines · Samreen
A null pointer check added.
Signed-off-by Samreen <[email protected]>---
drivers/video/omap2/omapfb/omapfb-main.c | 2 ++1 files changed, 2 insertions(+), 0 deletions(-)drivers/video/omap2/omapfb/omapfb-main.c +0
-0@@ -2133,6 +2133,8 @@ static int omapfb_parse_def_modes(struct omapfb2_device *fbdev) int r = 0;
Quoted 3 lines
Quoted 2 lines
str =
kmalloc(strlen(def_mode) + 1, GFP_KERNEL); + if (str == NULL) + return-EINVAL;Shouldn't be rerutn
_ENNOMEM; instead to get correct error code?
[Samreen]
Will fix this.
Quoted 6 lines
Quoted 6 lines
strcpy(str,
def_mode);
options = str;--
1.5.6.3
Quoted 8 lines
Quoted 5 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.htmlthank,
marek--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 15 lines · Ville Syrjälä
drivers/video/omap2/omapfb/omapfb-main.c static int
Quoted 13 lines · ext Samreen
A null pointer check added.
Signed-off-by Samreen <[email protected]>--- drivers/video/omap2/omapfb/omapfb-main.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)drivers/video/omap2/omapfb/omapfb-main.c +0
-0@@ -2133,6 +2133,8 @@ static int
omapfb_parse_def_modes(struct omapfb2_device *fbdev)
Quoted 8 lines
drivers/video/omap2/omapfb/omapfb-main.c static int omapfb_parse_def_modes(struct omapfb2_device *fbdev) · line 2138
Quoted 6 lines
drivers/video/omap2/omapfb/omapfb-main.c +2
-0int r =0 ; str =kmalloc (strlen (def_mode) +1 ,GFP_KERNEL ); +if (str ==NULL ) +return -EINVAL ;strcpy (str, def_mode);While you're at it you could change the code to use
kstrdup().
[Samreen]
Will use kstrdup() and post the patch soon.
Warm Regards,
Samreen--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html