cc2520: Ignore received bogus packets silently
Instead of return 0 if there is an error, return a value < 0 so that caller caller of cc2520_read() can reject packet right away. Change-Id: I99808db6aa692cf4415f630193d35e51d4bc3144 Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
cde38ed754
commit
44f990144b
1 changed files with 2 additions and 2 deletions
|
@ -841,7 +841,7 @@ static int cc2520_read(void *buf, unsigned short bufsize)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cc2520_pending_packet()) {
|
if (!cc2520_pending_packet()) {
|
||||||
return 0;
|
return -EAGAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
cc2520_packets_read++;
|
cc2520_packets_read++;
|
||||||
|
@ -893,7 +893,7 @@ error:
|
||||||
print_errors();
|
print_errors();
|
||||||
|
|
||||||
flushrx();
|
flushrx();
|
||||||
return 0;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void read_packet(void)
|
static void read_packet(void)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue