drm: correctly restore mappings if drm_open fails
If first drm_open fails, the error-handling path will
incorrectly restore inode's mapping to NULL. This can
cause the crash later on. Fix by separately storing
away mapping pointers that drm_open can touch and
restore each from its own respective variable if the
(thanks to Michal Hocko for investigating investigating and
finding the root cause of the bug)
v2: Use one variable to store file and inode mapping
since they are the same at the function entry.
Fix spelling mistakes in commit message.
v3: Add reference to the original bug report.
Reported-by: Marco Munderloh <email@example.com>
Tested-by: Marco Munderloh <firstname.lastname@example.org>
Signed-off-by: Ilija Hadzic <email@example.com>
Cc: Michal Hocko <firstname.lastname@example.org>
Signed-off-by: Dave Airlie <email@example.com>
1 file changed