]> git.baikalelectronics.ru Git - kernel.git/commit
dm cache: handle kmalloc failure allocating background_tracker struct
authorColin Ian King <colin.king@canonical.com>
Sat, 11 Mar 2017 19:09:45 +0000 (19:09 +0000)
committerMike Snitzer <snitzer@redhat.com>
Wed, 17 May 2017 13:44:53 +0000 (09:44 -0400)
commit3497f9420c6c1b09ba4d6aaf85251c29fd89921e
tree9a740e30fef998d6c173c2471263f2ad8ba343eb
parent7f155e30d9be110b582f8d57d41d97c9fe4862a1
dm cache: handle kmalloc failure allocating background_tracker struct

Currently there is no kmalloc failure check on the allocation of
the background_tracker struct in btracker_create(), and so a NULL return
will lead to a NULL pointer dereference.  Add a NULL check.

Detected by CoverityScan, CID#1416587 ("Dereference null return value")

Fixes: 908856e35 ("dm cache: significant rework to leverage dm-bio-prison-v2")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-cache-background-tracker.c