summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hns/hns_roce_ah.c
diff options
context:
space:
mode:
authorDoug Ledford2017-08-18 20:12:04 +0200
committerDoug Ledford2017-08-18 20:12:04 +0200
commitb0e32e20e3c63778d8c20a40d8bec8b18baffecb (patch)
tree2e0c3311c53889473b94d49132fe5b7cdee71d51 /drivers/infiniband/hw/hns/hns_roce_ah.c
parentMerge branch 'misc' into k.o/for-next (diff)
parentIB/uverbs: Fix NULL pointer dereference during device removal (diff)
downloadkernel-qcow2-linux-b0e32e20e3c63778d8c20a40d8bec8b18baffecb.tar.gz
kernel-qcow2-linux-b0e32e20e3c63778d8c20a40d8bec8b18baffecb.tar.xz
kernel-qcow2-linux-b0e32e20e3c63778d8c20a40d8bec8b18baffecb.zip
Merge branch 'k.o/for-4.13-rc' into k.o/for-next
Merging our (hopefully) final -rc pull branch into our for-next branch because some of our pending patches won't apply cleanly without having the -rc patches in our tree. Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/hns/hns_roce_ah.c')
-rw-r--r--drivers/infiniband/hw/hns/hns_roce_ah.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/hns/hns_roce_ah.c b/drivers/infiniband/hw/hns/hns_roce_ah.c
index f78a733a63ec..d545302b8ef8 100644
--- a/drivers/infiniband/hw/hns/hns_roce_ah.c
+++ b/drivers/infiniband/hw/hns/hns_roce_ah.c
@@ -64,8 +64,10 @@ struct ib_ah *hns_roce_create_ah(struct ib_pd *ibpd,
} else {
u8 *dmac = rdma_ah_retrieve_dmac(ah_attr);
- if (!dmac)
+ if (!dmac) {
+ kfree(ah);
return ERR_PTR(-EINVAL);
+ }
memcpy(ah->av.mac, dmac, ETH_ALEN);
}