Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

George Cherian and committed by
Herbert Xu
9bd82904 12cb3a1c

+5 -3
+3 -1
drivers/crypto/cavium/cpt/cptvf_main.c
··· 815 815 { 816 816 struct cpt_vf *cptvf = pci_get_drvdata(pdev); 817 817 818 - if (!cptvf) 818 + if (!cptvf) { 819 819 dev_err(&pdev->dev, "Invalid CPT-VF device\n"); 820 + return; 821 + } 820 822 821 823 /* Convey DOWN to PF */ 822 824 if (cptvf_send_vf_down(cptvf)) {
+2 -2
drivers/crypto/cavium/cpt/cptvf_reqmanager.c
··· 330 330 { 331 331 struct pci_dev *pdev = cptvf->pdev; 332 332 333 - if (!info || !cptvf) { 334 - dev_err(&pdev->dev, "Input params are incorrect for post processing\n"); 333 + if (!info) { 334 + dev_err(&pdev->dev, "incorrect cpt_info_buffer for post processing\n"); 335 335 return; 336 336 } 337 337