Commit 2eeac577 authored by Ritesh Harjani (IBM)'s avatar Ritesh Harjani (IBM) Committed by Madhavan Srinivasan
Browse files

pseries/papr-hvpipe: Simplify spin unlock usage in papr_hvpipe_handle_release()



Once the src_info is removed from the global list, no one can access it.
This simplies the usage of spin_unlock_irqrestore() in
papr_hvpipe_handle_release()

Signed-off-by: default avatarRitesh Harjani (IBM) <ritesh.list@gmail.com>
Signed-off-by: default avatarMadhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/4a980331557af3d10aada8576aaa16cddc691c65.1777606826.git.ritesh.list@gmail.com
parent d48654bd
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -460,6 +460,7 @@ static int papr_hvpipe_handle_release(struct inode *inode,
	src_info = file->private_data;
	list_del(&src_info->list);
	file->private_data = NULL;
	spin_unlock_irqrestore(&hvpipe_src_list_lock, flags);
	/*
	 * If the pipe for this specific source has any pending
	 * payload, issue recv HVPIPE RTAS so that pipe will not
@@ -467,10 +468,8 @@ static int papr_hvpipe_handle_release(struct inode *inode,
	 */
	if (src_info->hvpipe_status & HVPIPE_MSG_AVAILABLE) {
		src_info->hvpipe_status = 0;
		spin_unlock_irqrestore(&hvpipe_src_list_lock, flags);
		hvpipe_rtas_recv_msg(NULL, 0);
	} else
		spin_unlock_irqrestore(&hvpipe_src_list_lock, flags);
	}

	kfree(src_info);
	return 0;