diff options
author | Mike Snitzer <snitzer@kernel.org> | 2024-02-11 14:07:18 -0500 |
---|---|---|
committer | Mike Snitzer <snitzer@kernel.org> | 2024-03-04 15:07:55 -0500 |
commit | b259c1a60c379ad73d673d329892c7dc36313656 (patch) | |
tree | 6271010ccd982abc16fc80b07ca1aa61a57ef360 /drivers | |
parent | 672fc9b8c000e8162cb4fe6f2dfc990df968ee3a (diff) | |
download | linux-stable-b259c1a60c379ad73d673d329892c7dc36313656.tar.gz linux-stable-b259c1a60c379ad73d673d329892c7dc36313656.tar.bz2 linux-stable-b259c1a60c379ad73d673d329892c7dc36313656.zip |
dm vdo flush: initialize return to NULL in allocate_flush
Otherwise, error path could result in allocate_flush's subsequent
check for flush being non-NULL leading to false positive.
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Susan LeGendre-McGhee <slegendr@redhat.com>
Signed-off-by: Matthew Sakai <msakai@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/dm-vdo/flush.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-vdo/flush.c b/drivers/md/dm-vdo/flush.c index 330b18715027..391b6203efc6 100644 --- a/drivers/md/dm-vdo/flush.c +++ b/drivers/md/dm-vdo/flush.c @@ -100,7 +100,7 @@ static struct vdo_flush *vdo_waiter_as_flush(struct vdo_waiter *waiter) static void *allocate_flush(gfp_t gfp_mask, void *pool_data) { - struct vdo_flush *flush; + struct vdo_flush *flush = NULL; if ((gfp_mask & GFP_NOWAIT) == GFP_NOWAIT) { flush = uds_allocate_memory_nowait(sizeof(struct vdo_flush), __func__); |