Skip to content

Commit 9bd8290

Browse files
George Cherianherbertx
authored andcommitted
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 <[email protected]> Signed-off-by: George Cherian <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 12cb3a1 commit 9bd8290

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

drivers/crypto/cavium/cpt/cptvf_main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,8 +815,10 @@ static void cptvf_remove(struct pci_dev *pdev)
815815
{
816816
struct cpt_vf *cptvf = pci_get_drvdata(pdev);
817817

818-
if (!cptvf)
818+
if (!cptvf) {
819819
dev_err(&pdev->dev, "Invalid CPT-VF device\n");
820+
return;
821+
}
820822

821823
/* Convey DOWN to PF */
822824
if (cptvf_send_vf_down(cptvf)) {

drivers/crypto/cavium/cpt/cptvf_reqmanager.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ void do_post_process(struct cpt_vf *cptvf, struct cpt_info_buffer *info)
330330
{
331331
struct pci_dev *pdev = cptvf->pdev;
332332

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");
335335
return;
336336
}
337337

0 commit comments

Comments
 (0)