All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pawel Laszczak <pawell@cadence.com>
To: <peter.chen@kernel.org>
Cc: <gregkh@linuxfoundation.org>, <dan.carpenter@oracle.com>,
	<linux-usb@vger.kernel.org>, <kurahul@cadence.com>,
	Pawel Laszczak <pawell@cadence.com>
Subject: [PATCH] usb: cdnsp: Useless condition has been removed
Date: Thu, 29 Apr 2021 10:49:14 +0200	[thread overview]
Message-ID: <20210429084914.12003-1-pawell@gli-login.cadence.com> (raw)

From: Pawel Laszczak <pawell@cadence.com>

Patch removes the warning "variable dereferenced before
check 'pdev->dcbaa'" from cdnsp_mem_cleanup.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Pawel Laszczak <pawell@cadence.com>
---
 drivers/usb/cdns3/cdnsp-mem.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/cdns3/cdnsp-mem.c b/drivers/usb/cdns3/cdnsp-mem.c
index 5d4c4bfe15b7..a47948a1623f 100644
--- a/drivers/usb/cdns3/cdnsp-mem.c
+++ b/drivers/usb/cdns3/cdnsp-mem.c
@@ -1082,9 +1082,8 @@ void cdnsp_mem_cleanup(struct cdnsp_device *pdev)
 	dma_pool_destroy(pdev->device_pool);
 	pdev->device_pool = NULL;
 
-	if (pdev->dcbaa)
-		dma_free_coherent(dev, sizeof(*pdev->dcbaa),
-				  pdev->dcbaa, pdev->dcbaa->dma);
+	dma_free_coherent(dev, sizeof(*pdev->dcbaa),
+			  pdev->dcbaa, pdev->dcbaa->dma);
 
 	pdev->dcbaa = NULL;
 
-- 
2.25.1


             reply	other threads:[~2021-04-29  8:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-29  8:49 Pawel Laszczak [this message]
2021-04-30  3:43 ` [PATCH] usb: cdnsp: Useless condition has been removed Peter Chen
2021-04-30  4:52   ` Dan Carpenter
2021-04-30  7:11     ` Peter Chen
2021-04-30 11:51       ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210429084914.12003-1-pawell@gli-login.cadence.com \
    --to=pawell@cadence.com \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kurahul@cadence.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.chen@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.