提交 9bd82904 编写于 作者: G George Cherian 提交者: Herbert Xu

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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NGeorge Cherian <george.cherian@cavium.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 12cb3a1c
......@@ -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)) {
......
......@@ -330,8 +330,8 @@ void do_post_process(struct cpt_vf *cptvf, struct cpt_info_buffer *info)
{
struct pci_dev *pdev = cptvf->pdev;
if (!info || !cptvf) {
dev_err(&pdev->dev, "Input params are incorrect for post processing\n");
if (!info) {
dev_err(&pdev->dev, "incorrect cpt_info_buffer for post processing\n");
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册