m501fb: don't return zero on failure path in sm501fb_probe()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Fri, 31 Oct 2014 22:40:47 +0000 (01:40 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 6 Nov 2014 14:41:36 +0000 (16:41 +0200)
If no framebuffers found, sm501fb_probe() breaks off initialization,
deallocates sm501fb_info, but returns zero. As a result, use after free
can happen in sm501fb_remove().

The patch adds -ENODEV as a return value in this case.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

No differences found