aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMichal Vokáč <vokac.m@gmail.com>2016-11-04 06:30:03 -0400
committerMark Brown <broonie@kernel.org>2016-11-04 11:56:09 -0400
commite634b76caf830e802731e3491b24726883d1be98 (patch)
tree56cd762b2391b6d5f0413488cfedbf0b0ef5078b /tools
parent1001354ca34179f3db924eb66672442a173147dc (diff)
spi: spidev_test: Fix input file check when transferring file
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/spi/spidev_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/spi/spidev_test.c b/tools/spi/spidev_test.c
index f046b77cfefe..816f119c9b7b 100644
--- a/tools/spi/spidev_test.c
+++ b/tools/spi/spidev_test.c
@@ -315,7 +315,7 @@ static void transfer_file(int fd, char *filename)
315 pabort("can't stat input file"); 315 pabort("can't stat input file");
316 316
317 tx_fd = open(filename, O_RDONLY); 317 tx_fd = open(filename, O_RDONLY);
318 if (fd < 0) 318 if (tx_fd < 0)
319 pabort("can't open input file"); 319 pabort("can't open input file");
320 320
321 tx = malloc(sb.st_size); 321 tx = malloc(sb.st_size);