Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1cf9cc72 authored by Thomas Falcon's avatar Thomas Falcon Committed by David S. Miller
Browse files

ibmvnic: Remove VNIC_CLOSING check from pending_scrq



Fix a kernel panic resulting from data access of a NULL
pointer during device close. The pending_scrq routine is
meant to determine whether there is a valid sub-CRQ message
awaiting processing. When the device is closing, however,
there is a possibility that NULL messages can be processed
because pending_scrq will always return 1 even if there
no valid message in the queue.

It's not clear what this closing state check was originally
meant to accomplish, so just remove it.

Signed-off-by: default avatarThomas Falcon <tlfalcon@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c8b2ad0a
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -2275,8 +2275,7 @@ static int pending_scrq(struct ibmvnic_adapter *adapter,
{
{
	union sub_crq *entry = &scrq->msgs[scrq->cur];
	union sub_crq *entry = &scrq->msgs[scrq->cur];


	if (entry->generic.first & IBMVNIC_CRQ_CMD_RSP ||
	if (entry->generic.first & IBMVNIC_CRQ_CMD_RSP)
	    adapter->state == VNIC_CLOSING)
		return 1;
		return 1;
	else
	else
		return 0;
		return 0;