On Fri, Nov 12, 2010 at 12:47 PM, Samreen [off-list ref] wrote:
quoted hunk
A null pointer check added.
Signed-off-by: Samreen <redacted>
---
drivers/video/omap2/omapfb/omapfb-main.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 6a704f1..55bed89 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -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?
strcpy(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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
thank,
marek
--
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
A null pointer check added.
Signed-off-by: Samreen <redacted>
---
drivers/video/omap2/omapfb/omapfb-main.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 6a704f1..55bed89 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -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;
--
1.5.6.3
On Fri, Nov 12, 2010 at 12:47:15PM +0100, ext Samreen wrote:
quoted hunk
A null pointer check added.
Signed-off-by: Samreen <redacted>
---
drivers/video/omap2/omapfb/omapfb-main.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 6a704f1..55bed89 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -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().
--
Ville Syrjälä
Ville Syrjälä wrote:
On Fri, Nov 12, 2010 at 12:47:15PM +0100, ext Samreen wrote:
quoted
A null pointer check added.
Signed-off-by: Samreen <redacted>
---
drivers/video/omap2/omapfb/omapfb-main.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c
b/drivers/video/omap2/omapfb/omapfb-main.c
index 6a704f1..55bed89 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -2133,6 +2133,8 @@ static int
omapfb_parse_def_modes(struct omapfb2_device *fbdev)
quoted
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().
[Samreen]
Will use kstrdup() and post the patch soon.
Warm Regards,
Samreen