Message ID | fcc9f3ed-b8d0-4999-a06c-12a193a516d3@web.de (mailing list archive) |
---|---|
State | Rejected |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | nfc: mei_phy: Adjustments for two function implementations | expand |
diff --git a/drivers/nfc/mei_phy.c b/drivers/nfc/mei_phy.c index 937f229f4646..9272564012b3 100644 --- a/drivers/nfc/mei_phy.c +++ b/drivers/nfc/mei_phy.c @@ -157,8 +157,8 @@ static int mei_nfc_connect(struct nfc_mei_phy *phy) reply = kzalloc(connect_resp_length, GFP_KERNEL); if (!reply) { - kfree(cmd); - return -ENOMEM; + r = -ENOMEM; + goto free_cmd; } connect_resp = (struct mei_nfc_connect_resp *)reply->data; @@ -197,6 +197,7 @@ static int mei_nfc_connect(struct nfc_mei_phy *phy) err: kfree(reply); +free_cmd: kfree(cmd); return r;