Commit e634b76c authored by Michal Vokáč's avatar Michal Vokáč Committed by Mark Brown

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: default avatarMichal Vokáč <vokac.m@gmail.com>
Reviewed-by: default avatarJoshua Clayton <stillcompiling@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 1001354c
...@@ -315,7 +315,7 @@ static void transfer_file(int fd, char *filename) ...@@ -315,7 +315,7 @@ static void transfer_file(int fd, char *filename)
pabort("can't stat input file"); pabort("can't stat input file");
tx_fd = open(filename, O_RDONLY); tx_fd = open(filename, O_RDONLY);
if (fd < 0) if (tx_fd < 0)
pabort("can't open input file"); pabort("can't open input file");
tx = malloc(sb.st_size); tx = malloc(sb.st_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment