Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 36e8c27f authored by Samreen's avatar Samreen Committed by Tomi Valkeinen
Browse files

OMAP: DSS2: OMAPFB: Add null pointer check



A null pointer check added. And using kstrdup()
instead of kmalloc() & strcpy()

Signed-off-by: default avatarSamreen <samreen@ti.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@nokia.com>
parent ed3f9095
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -2132,8 +2132,9 @@ static int omapfb_parse_def_modes(struct omapfb2_device *fbdev)
	char *str, *options, *this_opt;
	char *str, *options, *this_opt;
	int r = 0;
	int r = 0;


	str = kmalloc(strlen(def_mode) + 1, GFP_KERNEL);
	str = kstrdup(def_mode, GFP_KERNEL);
	strcpy(str, def_mode);
	if (!str)
		return -ENOMEM;
	options = str;
	options = str;


	while (!r && (this_opt = strsep(&options, ",")) != NULL) {
	while (!r && (this_opt = strsep(&options, ",")) != NULL) {