Message ID | 20181030135427.19036-3-andrew.boyer@dell.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | RDMA/rxe: skb handling, link state, statistics | expand |
> On Oct 30, 2018, at 4:03 PM, Andrew Boyer <andrew.boyer@dell.com> wrote: > > kfree_skb() already handles the case in which skb is NULL. > > Signed-off-by: Andrew Boyer <andrew.boyer@dell.com> Reviewed-by: Majd Dibbiny <majd@mellanox.com> > --- > drivers/infiniband/sw/rxe/rxe_recv.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/infiniband/sw/rxe/rxe_recv.c b/drivers/infiniband/sw/rxe/rxe_recv.c > index 08ad9dc72205..26e82f5fb4cb 100644 > --- a/drivers/infiniband/sw/rxe/rxe_recv.c > +++ b/drivers/infiniband/sw/rxe/rxe_recv.c > @@ -328,8 +328,7 @@ static void rxe_rcv_mcast_pkt(struct rxe_dev *rxe, struct sk_buff *skb) > rxe_drop_ref(mcg); /* drop ref from rxe_pool_get_key. */ > > err1: > - if (skb) > - kfree_skb(skb); > + kfree_skb(skb); > } > > static int rxe_match_dgid(struct rxe_dev *rxe, struct sk_buff *skb) > -- > 2.16.2 >
On 2018/10/30 21:54, Andrew Boyer wrote: > kfree_skb() already handles the case in which skb is NULL. > > Signed-off-by: Andrew Boyer <andrew.boyer@dell.com> Reviewed-by: Zhu Yanjun <yanjun.zhu@oracle.com> > --- > drivers/infiniband/sw/rxe/rxe_recv.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/infiniband/sw/rxe/rxe_recv.c b/drivers/infiniband/sw/rxe/rxe_recv.c > index 08ad9dc72205..26e82f5fb4cb 100644 > --- a/drivers/infiniband/sw/rxe/rxe_recv.c > +++ b/drivers/infiniband/sw/rxe/rxe_recv.c > @@ -328,8 +328,7 @@ static void rxe_rcv_mcast_pkt(struct rxe_dev *rxe, struct sk_buff *skb) > rxe_drop_ref(mcg); /* drop ref from rxe_pool_get_key. */ > > err1: > - if (skb) > - kfree_skb(skb); > + kfree_skb(skb); > } > > static int rxe_match_dgid(struct rxe_dev *rxe, struct sk_buff *skb)
On 2018/10/31 6:34, Yanjun Zhu wrote: > > > On 2018/10/30 21:54, Andrew Boyer wrote: >> kfree_skb() already handles the case in which skb is NULL. >> >> Signed-off-by: Andrew Boyer <andrew.boyer@dell.com> > > Reviewed-by: Zhu Yanjun <yanjun.zhu@oracle.com> Sorry. My bad. I think this is also fixed in the latest linux kernel. Please check it again. Zhu Yanjun > >> --- >> drivers/infiniband/sw/rxe/rxe_recv.c | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/drivers/infiniband/sw/rxe/rxe_recv.c >> b/drivers/infiniband/sw/rxe/rxe_recv.c >> index 08ad9dc72205..26e82f5fb4cb 100644 >> --- a/drivers/infiniband/sw/rxe/rxe_recv.c >> +++ b/drivers/infiniband/sw/rxe/rxe_recv.c >> @@ -328,8 +328,7 @@ static void rxe_rcv_mcast_pkt(struct rxe_dev >> *rxe, struct sk_buff *skb) >> rxe_drop_ref(mcg); /* drop ref from rxe_pool_get_key. */ >> err1: >> - if (skb) >> - kfree_skb(skb); >> + kfree_skb(skb); >> } >> static int rxe_match_dgid(struct rxe_dev *rxe, struct sk_buff *skb) > >
diff --git a/drivers/infiniband/sw/rxe/rxe_recv.c b/drivers/infiniband/sw/rxe/rxe_recv.c index 08ad9dc72205..26e82f5fb4cb 100644 --- a/drivers/infiniband/sw/rxe/rxe_recv.c +++ b/drivers/infiniband/sw/rxe/rxe_recv.c @@ -328,8 +328,7 @@ static void rxe_rcv_mcast_pkt(struct rxe_dev *rxe, struct sk_buff *skb) rxe_drop_ref(mcg); /* drop ref from rxe_pool_get_key. */ err1: - if (skb) - kfree_skb(skb); + kfree_skb(skb); } static int rxe_match_dgid(struct rxe_dev *rxe, struct sk_buff *skb)
kfree_skb() already handles the case in which skb is NULL. Signed-off-by: Andrew Boyer <andrew.boyer@dell.com> --- drivers/infiniband/sw/rxe/rxe_recv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)