fsi: sbefifo: Fix checker warning about late NULL check

"dev" is dereferences before it's checked.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 32f7f89d
...@@ -706,13 +706,16 @@ static int __sbefifo_submit(struct sbefifo *sbefifo, ...@@ -706,13 +706,16 @@ static int __sbefifo_submit(struct sbefifo *sbefifo,
int sbefifo_submit(struct device *dev, const __be32 *command, size_t cmd_len, int sbefifo_submit(struct device *dev, const __be32 *command, size_t cmd_len,
__be32 *response, size_t *resp_len) __be32 *response, size_t *resp_len)
{ {
struct sbefifo *sbefifo = dev_get_drvdata(dev); struct sbefifo *sbefifo;
struct iov_iter resp_iter; struct iov_iter resp_iter;
struct kvec resp_iov; struct kvec resp_iov;
size_t rbytes; size_t rbytes;
int rc; int rc;
if (!dev || !sbefifo) if (!dev)
return -ENODEV;
sbefifo = dev_get_drvdata(dev);
if (!sbefifo)
return -ENODEV; return -ENODEV;
if (WARN_ON_ONCE(sbefifo->magic != SBEFIFO_MAGIC)) if (WARN_ON_ONCE(sbefifo->magic != SBEFIFO_MAGIC))
return -ENODEV; return -ENODEV;
......
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