• Trent Piepho's avatar
    V4L/DVB (4367): Videodev: Handle class_device related errors · 53dd8def
    Trent Piepho authored
    Add proper error checking and roll-back for failure of
    class_device_create_file() in videodev.c.  Print error messages and
    unroll partially created sysfs entries.
    Also, failure of class_device_register() in video_register_device() is
    handled correctly.  It was failing to de-allocate the minor number.  This
    must be done in video_register_device(), since the caller has no way of
    knowing if failure occurred before or after the class device was
    registered.
    Also added an error message if video_register_device() is called with
    an unknown type, which should never happen.
    Signed-off-by: default avatarTrent Piepho <xyzzy@speakeasy.org>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
    53dd8def
videodev.c 39.1 KB