Skip to contentSkip to conversation

NFC: Initial LLCP support

DISCUSSION Dan Carpenter 2 participants 2 messages Dec 16, 2011 – May 21, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello Samuel Ortiz,

This is a semi-automatic email about new static checker warnings.

The patch d646960f7986: "NFC: Initial LLCP support" from Dec 14, 2011, leads to the following Smatch complaint:

net/nfc/llcp/sock.c +47 llcp_sock_bind()
warn: variable dereferenced before check 'addr' (see line 45)

net/nfc/llcp/sock.c

    44	
    45		pr_debug("sk %p addr %p family %d\n", sk, addr, addr->sa_family);
                                                                ^^^^^^^^^^^^^^^

New dereference.

    46	
    47		if (!addr || addr->sa_family != AF_NFC)
                     ^^^^

New check.

    48			return -EINVAL;
    49	

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#1 lore raw
Quoted 14 lines · Dan Carpenter

Hello Samuel Ortiz,

This is a semi-automatic email about new static checker warnings.

The patch d646960f7986: "NFC: Initial LLCP support" from Dec 14, 2011, leads to the following Smatch complaint:

net/nfc/llcp/sock.c +47 llcp_sock_bind()
warn: variable dereferenced before check 'addr' (see line 45)

net/nfc/llcp/sock.c

    44	
    45		pr_debug("sk %p addr %p family %d\n", sk, addr, addr->sa_family);
                                                                ^^^^^^^^^^^^^^^
Quoted 7 lines

New dereference.

    46	
    47		if (!addr || addr->sa_family != AF_NFC)
                     ^^^^

New check.

This got lost in the holiday season. Probably the check can just be remove, yes?

regards,
dan carpenter

Quoted 6 lines
    48			return -EINVAL;
    49	

regards,
dan carpenter