projects
/
linux-2.6-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1001354
)
spi: spidev_test: Fix input file check when transferring file
author
Michal Vokáč
<vokac.m@gmail.com>
Fri, 4 Nov 2016 10:30:03 +0000
(11:30 +0100)
committer
Mark Brown
<broonie@kernel.org>
Fri, 4 Nov 2016 15:56:09 +0000
(09:56 -0600)
Check the input file fd instead of spidev fd.
The spidev fd is supposed to be OK otherwise the transfer_file() function
would not be called at all.
Signed-off-by: Michal Vokáč <vokac.m@gmail.com>
Reviewed-by: Joshua Clayton <stillcompiling@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
tools/spi/spidev_test.c
patch
|
blob
|
blame
|
history
diff --git
a/tools/spi/spidev_test.c
b/tools/spi/spidev_test.c
index f046b77cfefe3056a72b82aa2194eb55e8b2fa93..816f119c9b7b1584a587077a55e28691418ff706 100644
(file)
--- a/
tools/spi/spidev_test.c
+++ b/
tools/spi/spidev_test.c
@@
-315,7
+315,7
@@
static void transfer_file(int fd, char *filename)
pabort("can't stat input file");
tx_fd = open(filename, O_RDONLY);
- if (fd < 0)
+ if (
tx_
fd < 0)
pabort("can't open input file");
tx = malloc(sb.st_size);