linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Salil Kapur <salilkapur93@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: USB: Removing NULL check for pool since dma_pool_destroy is safe
Date: Mon, 27 Aug 2018 21:24:34 -0400	[thread overview]
Message-ID: <20180828012434.GA19415@Salils-Air.fios-router.home> (raw)

Removing NULL check for pool since dma_pool_destroy is safe

Signed-off-by: Salil Kapur <salilkapur93@gmail.com>
---
 drivers/usb/core/buffer.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

--
2.14.4

diff --git a/drivers/usb/core/buffer.c b/drivers/usb/core/buffer.c
index 77eef8acff94..f641342cdec0 100644
--- a/drivers/usb/core/buffer.c
+++ b/drivers/usb/core/buffer.c
@@ -101,12 +101,8 @@ void hcd_buffer_destroy(struct usb_hcd *hcd)
 		return;

 	for (i = 0; i < HCD_BUFFER_POOLS; i++) {
-		struct dma_pool *pool = hcd->pool[i];
-
-		if (pool) {
-			dma_pool_destroy(pool);
-			hcd->pool[i] = NULL;
-		}
+		dma_pool_destroy(hcd->pool[i]);
+		hcd->pool[i] = NULL;
 	}
 }


             reply	other threads:[~2018-08-28  1:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-28  1:24 Salil Kapur [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-08-06  4:28 USB: Removing NULL check for pool since dma_pool_destroy is safe Salil Kapur
2018-08-05 14:27 Greg Kroah-Hartman
2018-08-04  7:10 Salil Kapur

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=20180828012434.GA19415@Salils-Air.fios-router.home \
    --to=salilkapur93@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).