From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933099AbbJHOSL (ORCPT ); Thu, 8 Oct 2015 10:18:11 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:32818 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932480AbbJHOSI (ORCPT ); Thu, 8 Oct 2015 10:18:08 -0400 Date: Thu, 8 Oct 2015 19:47:59 +0530 From: Sudip Mukherjee To: Jassi Brar Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] PCC: fix dereference of ERR_PTR Message-ID: <20151008141759.GA10587@sudip-pc> References: <1442412264-1701-1-git-send-email-sudipm.mukherjee@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1442412264-1701-1-git-send-email-sudipm.mukherjee@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 16, 2015 at 07:34:24PM +0530, Sudip Mukherjee wrote: > get_pcc_channel() does not return NULL on error it returns the error code > in ERR_PTR, but we have been checking it for NULL. > > Signed-off-by: Sudip Mukherjee > --- A gentle ping. regards sudip > drivers/mailbox/pcc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c > index 68885a8..45d85ae 100644 > --- a/drivers/mailbox/pcc.c > +++ b/drivers/mailbox/pcc.c > @@ -122,7 +122,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); > } > -- > 1.9.1 >