[RHEL7,COMMIT] ms/PCC: fix dereference of ERR_PTR

Submitted by Konstantin Khorenko on June 16, 2020, 11:04 a.m.

Details

Message ID 202006161104.05GB47ST031001@finist-ce7.sw.ru
State New
Headers show

Patch hide | download patch | download mbox

diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c
index 0a48739ae7e42..838e6cf4717e8 100644
--- a/drivers/mailbox/pcc.c
+++ b/drivers/mailbox/pcc.c
@@ -253,7 +253,7 @@  struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl,
 	 */
 	chan = get_pcc_channel(subspace_id);
 
-	if (!chan || chan->cl) {
+	if (IS_ERR(chan) || chan->cl) {
 		dev_err(dev, "Channel not found for idx: %d\n", subspace_id);
 		return ERR_PTR(-EBUSY);
 	}