drm/mgag200: Fix driver_load error handling
authorArchit Taneja <architt@codeaurora.org>
Thu, 17 Sep 2015 11:00:55 +0000 (16:30 +0530)
committerDave Airlie <airlied@redhat.com>
Wed, 23 Sep 2015 22:10:44 +0000 (08:10 +1000)
commit728f86607d47f7d2d24d61fd30852faa66ca5aa9
tree69ae962bc6493482bdcf5ee9ea206df17e9b00f7
parentaec9e12953e777f62acdab069656ebd9bcb6c9ba
drm/mgag200: Fix driver_load error handling

mgag200_driver_load's error path just calls the drm driver's
driver_unload op. It isn't safe to call this because it doesn't handle
things well if driver_load fails somewhere mid way.

Replace the call to mgag200_driver_unload with a more finegrained
error handling path.

Link: http://lkml.kernel.org/r/55F6E68D.8070800@codeaurora.org
Reported-by: Ingo Molnar <mingo@kernel.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Dave Airlie <airlied@gmail.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: dri-devel <dri-devel@lists.freedesktop.org>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/mgag200/mgag200_main.c