]> git.baikalelectronics.ru Git - kernel.git/commit
video/logo: prevent use of logos after they have been freed
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 18 Dec 2014 11:40:06 +0000 (13:40 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 29 Dec 2014 08:06:55 +0000 (10:06 +0200)
commit224a74590a3cf249107574be8056bfa19a438022
treec4163d947c09748b6dbc70e748d340dad136a8ff
parentedec1e38576547e4aea5c661bddc609cd508728a
video/logo: prevent use of logos after they have been freed

If the probe of an fb driver has been deferred due to missing
dependencies, and the probe is later ran when a module is loaded, the
fbdev framework will try to find a logo to use.

However, the logos are __initdata, and have already been freed. This
causes sometimes page faults, if the logo memory is not mapped,
sometimes other random crashes as the logo data is invalid, and
sometimes nothing, if the fbdev decides to reject the logo (e.g. the
random value depicting the logo's height is too big).

This patch adds a late_initcall function to mark the logos as freed. In
reality the logos are freed later, and fbdev probe may be ran between
this late_initcall and the freeing of the logos. In that case we will
miss drawing the logo, even if it would be possible.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: stable@vger.kernel.org
drivers/video/logo/logo.c