Skip to content

Commit

Permalink
NFC: Fix LLCP TLV building routine
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Samuel Ortiz authored and linvjw committed Apr 12, 2012
1 parent 279cf17 commit 324b0af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/nfc/llcp/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 324b0af

Please sign in to comment.