lkml.org 
[lkml]   [2024]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net v4] nfc: nci: Fix uninit-value in nci_rx_work
On Thu,  9 May 2024 20:30:33 +0900 Ryosuke Yasuoka wrote:
> - if (!nci_plen(skb->data)) {
> + if (!skb->len) {
> kfree_skb(skb);
> - kcov_remote_stop();
> - break;
> + continue;

the change from break to continue looks unrelated

> }

> - nci_ntf_packet(ndev, skb);
> + if (nci_valid_size(skb, NCI_CTRL_HDR_SIZE))

> + if (nci_valid_size(skb, NCI_DATA_HDR_SIZE))


#define NCI_CTRL_HDR_SIZE 3
#define NCI_DATA_HDR_SIZE 3

you can add a BUILD_BUG_ON(NCI_CTRL_HDR_SIZE == NCI_DATA_HDR_SIZE)
and save all the code duplication.

\
 
 \ /
  Last update: 2024-05-27 18:24    [W:0.061 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site