fs: exfat: Perform NULL check before dereference
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Tue, 8 Jul 2025 11:16:41 +0000 (12:16 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 15 Jul 2025 15:55:48 +0000 (09:55 -0600)
commit505e2734756018af953d2e5bd1cd6ff7b66b0cdb
tree1a845e272705106919f3f17d7d0225ea10957554
parentd1d53c252a4a746db5ebcdf0d6de3aa0feec504e
fs: exfat: Perform NULL check before dereference

In the functions exfat_pread and exfat_pwrite there is a NULL check for
ctxt.cur_dev but this has already been derefenced twice before this
happens.
Refactor the code a bit to put the NULL check first.

This issue found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
fs/exfat/io.c