From: Jody McIntyre <scjody@steamballoon.com>

This patch removes redundant NULL pointer checks before kfree() in all of
drivers/ieee1394/

Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: Jody McIntyre <scjody@steamballoon.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 drivers/ieee1394/nodemgr.c   |    3 +--
 drivers/ieee1394/ohci1394.c  |    2 +-
 drivers/ieee1394/video1394.c |   29 ++++++++---------------------
 3 files changed, 10 insertions(+), 24 deletions(-)

diff -puN drivers/ieee1394/nodemgr.c~ieee1394-remove-null-checks-prior-to-kfree-in-ieee1394-kfree-handles-null-pointers-fin drivers/ieee1394/nodemgr.c
--- 25/drivers/ieee1394/nodemgr.c~ieee1394-remove-null-checks-prior-to-kfree-in-ieee1394-kfree-handles-null-pointers-fin	2005-05-06 18:27:00.000000000 -0700
+++ 25-akpm/drivers/ieee1394/nodemgr.c	2005-05-06 18:27:00.000000000 -0700
@@ -1006,8 +1006,7 @@ static struct unit_directory *nodemgr_pr
 	return ud;
 
 unit_directory_error:
-	if (ud != NULL)
-		kfree(ud);
+	kfree(ud);
 	return NULL;
 }
 
diff -puN drivers/ieee1394/ohci1394.c~ieee1394-remove-null-checks-prior-to-kfree-in-ieee1394-kfree-handles-null-pointers-fin drivers/ieee1394/ohci1394.c
--- 25/drivers/ieee1394/ohci1394.c~ieee1394-remove-null-checks-prior-to-kfree-in-ieee1394-kfree-handles-null-pointers-fin	2005-05-06 18:27:00.000000000 -0700
+++ 25-akpm/drivers/ieee1394/ohci1394.c	2005-05-06 18:27:00.000000000 -0700
@@ -2931,7 +2931,7 @@ static void free_dma_rcv_ctx(struct dma_
 		kfree(d->prg_cpu);
 		kfree(d->prg_bus);
 	}
-	if (d->spb) kfree(d->spb);
+	kfree(d->spb);
 
 	/* Mark this context as freed. */
 	d->ohci = NULL;
diff -puN drivers/ieee1394/video1394.c~ieee1394-remove-null-checks-prior-to-kfree-in-ieee1394-kfree-handles-null-pointers-fin drivers/ieee1394/video1394.c
--- 25/drivers/ieee1394/video1394.c~ieee1394-remove-null-checks-prior-to-kfree-in-ieee1394-kfree-handles-null-pointers-fin	2005-05-06 18:27:00.000000000 -0700
+++ 25-akpm/drivers/ieee1394/video1394.c	2005-05-06 18:27:00.000000000 -0700
@@ -180,23 +180,13 @@ static int free_dma_iso_ctx(struct dma_i
 		kfree(d->prg_reg);
 	}
 
-	if (d->ir_prg)
-		kfree(d->ir_prg);
-
-	if (d->it_prg)
-		kfree(d->it_prg);
-
-	if (d->buffer_status)
-		kfree(d->buffer_status);
-	if (d->buffer_time)
-		kfree(d->buffer_time);
-	if (d->last_used_cmd)
-		kfree(d->last_used_cmd);
-	if (d->next_buffer)
-		kfree(d->next_buffer);
-
+	kfree(d->ir_prg);
+	kfree(d->it_prg);
+	kfree(d->buffer_status);
+	kfree(d->buffer_time);
+	kfree(d->last_used_cmd);
+	kfree(d->next_buffer);
 	list_del(&d->link);
-
 	kfree(d);
 
 	return 0;
@@ -1060,8 +1050,7 @@ static int __video1394_ioctl(struct file
 			PRINT(KERN_ERR, ohci->host->id,
 			      "Buffer %d is already used",v.buffer);
 			spin_unlock_irqrestore(&d->lock,flags);
-			if (psizes)
-				kfree(psizes);
+			kfree(psizes);
 			return -EBUSY;
 		}
 
@@ -1116,9 +1105,7 @@ static int __video1394_ioctl(struct file
 			}
 		}
 
-		if (psizes)
-			kfree(psizes);
-
+		kfree(psizes);
 		return 0;
 
 	}
_