* [PATCH] PCC: fix dereference of ERR_PTR
@ 2015-09-16 14:04 Sudip Mukherjee
2015-10-08 14:17 ` Sudip Mukherjee
0 siblings, 1 reply; 2+ messages in thread
From: Sudip Mukherjee @ 2015-09-16 14:04 UTC (permalink / raw)
To: Jassi Brar; +Cc: linux-kernel, Sudip Mukherjee
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 <sudip@vectorindia.org>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] PCC: fix dereference of ERR_PTR
2015-09-16 14:04 [PATCH] PCC: fix dereference of ERR_PTR Sudip Mukherjee
@ 2015-10-08 14:17 ` Sudip Mukherjee
0 siblings, 0 replies; 2+ messages in thread
From: Sudip Mukherjee @ 2015-10-08 14:17 UTC (permalink / raw)
To: Jassi Brar; +Cc: linux-kernel
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 <sudip@vectorindia.org>
> ---
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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-08 14:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-16 14:04 [PATCH] PCC: fix dereference of ERR_PTR Sudip Mukherjee
2015-10-08 14:17 ` Sudip Mukherjee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox