mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2/2] Staging: crystalhd: removed kfree(NULL) checks
@ 2010-05-27  4:38 Scott Kidder
  0 siblings, 0 replies; only message in thread
From: Scott Kidder @ 2010-05-27  4:38 UTC (permalink / raw)
  To: jarod, adraham.manu, davilla; +Cc: devel, linux-kernel, Scott Kidder

Removed kfree(NULL checks) that were not necessary

Signed-off-by: Scott Kidder <scott.kidder11@gmail.com>
---
 drivers/staging/crystalhd/crystalhd_lnx.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c b/drivers/staging/crystalhd/crystalhd_lnx.c
index a4ec891..9d2805a 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.c
+++ b/drivers/staging/crystalhd/crystalhd_lnx.c
@@ -152,10 +152,8 @@ static int chd_dec_fetch_cdata(struct crystalhd_adp *adp, struct crystalhd_ioctl
 	if (rc) {
 		BCMLOG_ERR("failed to pull add_cdata sz:%x ua_off:%x\n",
 			   io->add_cdata_sz, (unsigned int)ua_off);
-		if (io->add_cdata) {
-			kfree(io->add_cdata);
-			io->add_cdata = NULL;
-		}
+		kfree(io->add_cdata);
+		io->add_cdata = NULL;
 		return -ENODATA;
 	}

@@ -435,8 +433,7 @@ static void __devexit chd_dec_release_chdev(struct crystalhd_adp *adp)
 	/* Clear iodata pool.. */
 	do {
 		temp = chd_dec_alloc_iodata(adp, 0);
-		if (temp)
-			kfree(temp);
+		kfree(temp);
 	} while (temp);

 	crystalhd_delete_elem_pool(adp);
--
1.7.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-05-27  3:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-27  4:38 [PATCH 2/2] Staging: crystalhd: removed kfree(NULL) checks Scott Kidder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®