Skip to content

Commit

Permalink
dm vdo flush: initialize return to NULL in allocate_flush
Browse files Browse the repository at this point in the history
Otherwise, error path could result in allocate_flush's subsequent
check for flush being non-NULL leading to false positive.

Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
Signed-off-by: Susan LeGendre-McGhee <[email protected]>
Signed-off-by: Matthew Sakai <[email protected]>
  • Loading branch information
Mike Snitzer authored and lorelei-sakai committed Feb 20, 2024
1 parent 8e3b9b7 commit f596e9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/md/dm-vdo/flush.c
Original file line number Diff line number Diff line change
Expand Up @@ -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__);
Expand Down

0 comments on commit f596e9c

Please sign in to comment.