Skip to content

Commit 8b4bdc3

Browse files
author
Fox Snowpatch
committed
1 parent 182544a commit 8b4bdc3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

arch/powerpc/platforms/pseries/papr-hvpipe.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ static const struct file_operations papr_hvpipe_handle_ops = {
480480
static int papr_hvpipe_dev_create_handle(u32 srcID)
481481
{
482482
struct hvpipe_source_info *src_info __free(kfree) = NULL;
483+
struct hvpipe_source_info *owned_src_info;
483484

484485
spin_lock(&hvpipe_src_list_lock);
485486
/*
@@ -509,7 +510,7 @@ static int papr_hvpipe_dev_create_handle(u32 srcID)
509510
if (fdf.err)
510511
return fdf.err;
511512

512-
retain_and_null_ptr(src_info);
513+
owned_src_info = retain_and_null_ptr(src_info);
513514
spin_lock(&hvpipe_src_list_lock);
514515
/*
515516
* If two processes are executing ioctl() for the same
@@ -520,7 +521,7 @@ static int papr_hvpipe_dev_create_handle(u32 srcID)
520521
spin_unlock(&hvpipe_src_list_lock);
521522
return -EALREADY;
522523
}
523-
list_add(&src_info->list, &hvpipe_src_list);
524+
list_add(&owned_src_info->list, &hvpipe_src_list);
524525
spin_unlock(&hvpipe_src_list_lock);
525526
return fd_publish(fdf);
526527
}

0 commit comments

Comments
 (0)