Commit 7fdfc702 authored by Sudip Mukherjee's avatar Sudip Mukherjee Committed by Tomi Valkeinen

fbdev: n411: check return value

We were not checking the return value of platform_device_add_data()
which can fail.
Signed-off-by: default avatarSudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent f059c4b2
...@@ -165,16 +165,22 @@ static int __init n411_init(void) ...@@ -165,16 +165,22 @@ static int __init n411_init(void)
if (!n411_device) if (!n411_device)
return -ENOMEM; return -ENOMEM;
platform_device_add_data(n411_device, &n411_board, sizeof(n411_board)); ret = platform_device_add_data(n411_device, &n411_board,
sizeof(n411_board));
if (ret)
goto put_plat_device;
/* this _add binds hecubafb to n411. hecubafb refcounts n411 */ /* this _add binds hecubafb to n411. hecubafb refcounts n411 */
ret = platform_device_add(n411_device); ret = platform_device_add(n411_device);
if (ret) if (ret)
platform_device_put(n411_device); goto put_plat_device;
return ret; return 0;
put_plat_device:
platform_device_put(n411_device);
return ret;
} }
static void __exit n411_exit(void) static void __exit n411_exit(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment