st21nfca_tm_send_atr_res() misses to call kfree_skb() in an error path. Add the missed function call to fix it.
Unified · Split
| @@ -173,8 +173,10 @@ static int st21nfca_tm_send_atr_res(struct nfc_hci_dev *hdev, · 172 unmodified lines | ||
| 173 | 173 | memcpy(atr_res->gbi, atr_req->gbi, gb_len); |
| 174 | 174 | r = nfc_set_remote_general_bytes(hdev->ndev, atr_res->gbi, |
| 175 | 175 | gb_len); |
| 176 | − if (r < 0) | |
| 176 | + if (r < 0) { | |
| 177 | + kfree_skb(skb); | |
| 177 | 178 | return r; |
| 179 | + } | |
| 178 | 180 | } |
| 179 | 181 | |
| 180 | 182 | info->dep_info.curr_nfc_dep_pni = 0; |