summaryrefslogtreecommitdiff
path: root/drivers/crypto/cavium/cpt/cptvf_main.c
diff options
context:
space:
mode:
authorGeorge Cherian <george.cherian@cavium.com>2017-02-15 15:42:19 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2017-02-27 13:09:37 +0300
commit9bd829041b704e5e501ad5f5a9374a63426763fd (patch)
tree2e4f1d2209f67d3052299f6721eaa4fdc2197aea /drivers/crypto/cavium/cpt/cptvf_main.c
parent12cb3a1c4184f891d965d1f39f8cfcc9ef617647 (diff)
downloadlinux-9bd829041b704e5e501ad5f5a9374a63426763fd.tar.xz
crypto: cavium - Fix couple of static checker errors
Fix the following smatch errors cptvf_reqmanager.c:333 do_post_process() warn: variable dereferenced before check 'cptvf' cptvf_main.c:825 cptvf_remove() error: we previously assumed 'cptvf' could be null Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: George Cherian <george.cherian@cavium.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/cavium/cpt/cptvf_main.c')
-rw-r--r--drivers/crypto/cavium/cpt/cptvf_main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/crypto/cavium/cpt/cptvf_main.c b/drivers/crypto/cavium/cpt/cptvf_main.c
index aac2966ff8d9..e50872e666d6 100644
--- a/drivers/crypto/cavium/cpt/cptvf_main.c
+++ b/drivers/crypto/cavium/cpt/cptvf_main.c
@@ -815,8 +815,10 @@ static void cptvf_remove(struct pci_dev *pdev)
{
struct cpt_vf *cptvf = pci_get_drvdata(pdev);
- if (!cptvf)
+ if (!cptvf) {
dev_err(&pdev->dev, "Invalid CPT-VF device\n");
+ return;
+ }
/* Convey DOWN to PF */
if (cptvf_send_vf_down(cptvf)) {