Message ID | 20170713074548.i6cgpjhmmcnvtd5c@mwanda (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
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>
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@oracle.com> This was accepted into 4.13-rc, thanks.
Thanks! Reviewed-by: Zhu Yanjun <yanjun.zhu@oracle.com> 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@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)) > -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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))
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> -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html