summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2012-04-10 19:43:15 +0200
committerJohn W. Linville <linville@tuxdriver.com>2012-04-12 15:10:41 -0400
commit324b0af6f5a48dc38dac016eed14d019cac5903f (patch)
tree99cd8b67782a1331ed36b0185737834ed42b5618 /net
parent279cf174aea84202c5fef4675ff3f1265f071c8e (diff)
downloadlinux-324b0af6f5a48dc38dac016eed14d019cac5903f.tar.gz
linux-324b0af6f5a48dc38dac016eed14d019cac5903f.tar.bz2
linux-324b0af6f5a48dc38dac016eed14d019cac5903f.zip
NFC: Fix LLCP TLV building routine
The if logic could lead to zero length TLVs. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/nfc/llcp/commands.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/nfc/llcp/commands.c b/net/nfc/llcp/commands.c
index 4aa52b8b6c0c..34ee6847806a 100644
--- a/net/nfc/llcp/commands.c
+++ b/net/nfc/llcp/commands.c
@@ -102,7 +102,7 @@ u8 *nfc_llcp_build_tlv(u8 type, u8 *value, u8 value_length, u8 *tlv_length)
length = llcp_tlv_length[type];
if (length == 0 && value_length == 0)
return NULL;
- else
+ else if (length == 0)
length = value_length;
*tlv_length = 2 + length;