Skip to content

Commit

Permalink
nfc: st-nci: remove unnecessary label
Browse files Browse the repository at this point in the history
in st_nci_spi_write function, first assign a value to a variable then
goto exit label. return statement just follow the label and exit label
just used once, so we should directly return and remove exit label.

Signed-off-by: wengjianfeng <wengjianfeng@yulong.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
wengjianfeng authored and David S. Miller committed Apr 13, 2021
1 parent 334c424 commit eba43fa
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/nfc/st-nci/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,14 @@ static int st_nci_spi_write(void *phy_id, struct sk_buff *skb)
*/
if (!r) {
skb_rx = alloc_skb(skb->len, GFP_KERNEL);
if (!skb_rx) {
r = -ENOMEM;
goto exit;
}
if (!skb_rx)
return -ENOMEM;

skb_put(skb_rx, skb->len);
memcpy(skb_rx->data, buf, skb->len);
ndlc_recv(phy->ndlc, skb_rx);
}

exit:
return r;
}

Expand Down

0 comments on commit eba43fa

Please sign in to comment.