Skip to content

Commit

Permalink
spi: spidev_test: Fix input file check when transferring file
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michal Vokáč authored and Mark Brown committed Nov 4, 2016
1 parent 1001354 commit e634b76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/spi/spidev_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e634b76

Please sign in to comment.