* [PATCH] IB/IPoIB: Fix error code in ipoib_add_port()
@ 2017-07-13 7:45 Dan Carpenter
2017-07-13 10:25 ` Leon Romanovsky
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2017-07-13 7:45 UTC (permalink / raw)
To: Doug Ledford
Cc: Sean Hefty, Hal Rosenstock, Leon Romanovsky, Erez Shitrit,
Alex Vesker, Dasaratharaman Chandramouli, Feras Daoud, Zhu Yanjun,
Shamir Rabinovitch, Paolo Abeni, David Ahern, linux-rdma,
kernel-janitors
We accidentally don't see the error code on some of these error paths.
It means we return ERR_PTR(0) which is NULL and it results in a NULL
dereference in the caller.
This bug dates to pre-git days.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index 6e86eeee370e..ddd8114b6713 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -2212,6 +2212,7 @@ static struct net_device *ipoib_add_port(const char *format,
goto register_failed;
}
+ result = -ENOMEM;
if (ipoib_cm_add_mode_attr(priv->dev))
goto sysfs_failed;
if (ipoib_add_pkey_attr(priv->dev))
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] IB/IPoIB: Fix error code in ipoib_add_port()
2017-07-13 7:45 [PATCH] IB/IPoIB: Fix error code in ipoib_add_port() Dan Carpenter
@ 2017-07-13 10:25 ` Leon Romanovsky
2017-07-22 17:27 ` Doug Ledford
2017-07-24 2:53 ` Yanjun Zhu
2 siblings, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2017-07-13 10:25 UTC (permalink / raw)
To: Dan Carpenter
Cc: Doug Ledford, Sean Hefty, Hal Rosenstock, Erez Shitrit,
Alex Vesker, Dasaratharaman Chandramouli, Feras Daoud, Zhu Yanjun,
Shamir Rabinovitch, Paolo Abeni, David Ahern, linux-rdma,
kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 722 bytes --]
On Thu, Jul 13, 2017 at 10:45:48AM +0300, Dan Carpenter wrote:
> We accidentally don't see the error code on some of these error paths.
> It means we return ERR_PTR(0) which is NULL and it results in a NULL
> dereference in the caller.
>
> This bug dates to pre-git days.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
> index 6e86eeee370e..ddd8114b6713 100644
> --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
> +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
> @@ -2212,6 +2212,7 @@ static struct net_device *ipoib_add_port(const char *format,
Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] IB/IPoIB: Fix error code in ipoib_add_port()
2017-07-13 7:45 [PATCH] IB/IPoIB: Fix error code in ipoib_add_port() Dan Carpenter
2017-07-13 10:25 ` Leon Romanovsky
@ 2017-07-22 17:27 ` Doug Ledford
2017-07-24 2:53 ` Yanjun Zhu
2 siblings, 0 replies; 4+ messages in thread
From: Doug Ledford @ 2017-07-22 17:27 UTC (permalink / raw)
To: Dan Carpenter
Cc: Sean Hefty, Hal Rosenstock, Leon Romanovsky, Erez Shitrit,
Alex Vesker, Dasaratharaman Chandramouli, Feras Daoud, Zhu Yanjun,
Shamir Rabinovitch, Paolo Abeni, David Ahern,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
kernel-janitors-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1.1: Type: text/plain, Size: 576 bytes --]
On 7/13/2017 3:45 AM, Dan Carpenter wrote:
> We accidentally don't see the error code on some of these error paths.
> It means we return ERR_PTR(0) which is NULL and it results in a NULL
> dereference in the caller.
>
> This bug dates to pre-git days.
>
> Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
This was accepted into 4.13-rc, thanks.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG Key ID: B826A3330E572FDD
Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] IB/IPoIB: Fix error code in ipoib_add_port()
2017-07-13 7:45 [PATCH] IB/IPoIB: Fix error code in ipoib_add_port() Dan Carpenter
2017-07-13 10:25 ` Leon Romanovsky
2017-07-22 17:27 ` Doug Ledford
@ 2017-07-24 2:53 ` Yanjun Zhu
2 siblings, 0 replies; 4+ messages in thread
From: Yanjun Zhu @ 2017-07-24 2:53 UTC (permalink / raw)
To: Dan Carpenter, Doug Ledford
Cc: Sean Hefty, Hal Rosenstock, Leon Romanovsky, Erez Shitrit,
Alex Vesker, Dasaratharaman Chandramouli, Feras Daoud,
Shamir Rabinovitch, Paolo Abeni, David Ahern,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
kernel-janitors-u79uwXL29TY76Z2rM5mHXA
Thanks!
Reviewed-by: Zhu Yanjun <yanjun.zhu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
On 2017/7/13 15:45, Dan Carpenter wrote:
> We accidentally don't see the error code on some of these error paths.
> It means we return ERR_PTR(0) which is NULL and it results in a NULL
> dereference in the caller.
>
> This bug dates to pre-git days.
>
> Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
>
> diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
> index 6e86eeee370e..ddd8114b6713 100644
> --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
> +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
> @@ -2212,6 +2212,7 @@ static struct net_device *ipoib_add_port(const char *format,
> goto register_failed;
> }
>
> + result = -ENOMEM;
> if (ipoib_cm_add_mode_attr(priv->dev))
> goto sysfs_failed;
> if (ipoib_add_pkey_attr(priv->dev))
>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-07-24 2:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-13 7:45 [PATCH] IB/IPoIB: Fix error code in ipoib_add_port() Dan Carpenter
2017-07-13 10:25 ` Leon Romanovsky
2017-07-22 17:27 ` Doug Ledford
2017-07-24 2:53 ` Yanjun Zhu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox