aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJody McIntyre <scjody@steamballoon.com>2005-05-17 00:54:01 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-17 10:59:23 -0400
commit616b859fbd0e59707a24612d5b5fec791156c822 (patch)
tree2c58dbdfc262006886ac25a8d56c973b4f6a6772
parent9ac485dc37b6336c5bf694f9933f43684fd1fd1e (diff)
[PATCH] ieee1394: remove NULL checks for kfree
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> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/ieee1394/nodemgr.c3
-rw-r--r--drivers/ieee1394/ohci1394.c2
-rw-r--r--drivers/ieee1394/video1394.c29
3 files changed, 10 insertions, 24 deletions
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index a1e30a66297b..83e66ed97ab5 100644
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@ -1005,8 +1005,7 @@ static struct unit_directory *nodemgr_process_unit_directory
1005 return ud; 1005 return ud;
1006 1006
1007unit_directory_error: 1007unit_directory_error:
1008 if (ud != NULL) 1008 kfree(ud);
1009 kfree(ud);
1010 return NULL; 1009 return NULL;
1011} 1010}
1012 1011
diff --git a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c
index 6cb0b586c297..36e25ac823dc 100644
--- a/drivers/ieee1394/ohci1394.c
+++ b/drivers/ieee1394/ohci1394.c
@@ -2931,7 +2931,7 @@ static void free_dma_rcv_ctx(struct dma_rcv_ctx *d)
2931 kfree(d->prg_cpu); 2931 kfree(d->prg_cpu);
2932 kfree(d->prg_bus); 2932 kfree(d->prg_bus);
2933 } 2933 }
2934 if (d->spb) kfree(d->spb); 2934 kfree(d->spb);
2935 2935
2936 /* Mark this context as freed. */ 2936 /* Mark this context as freed. */
2937 d->ohci = NULL; 2937 d->ohci = NULL;
diff --git a/drivers/ieee1394/video1394.c b/drivers/ieee1394/video1394.c
index 4bedf7113f40..6eb9b80b1bce 100644
--- a/drivers/ieee1394/video1394.c
+++ b/drivers/ieee1394/video1394.c
@@ -180,23 +180,13 @@ static int free_dma_iso_ctx(struct dma_iso_ctx *d)
180 kfree(d->prg_reg); 180 kfree(d->prg_reg);
181 } 181 }
182 182
183 if (d->ir_prg) 183 kfree(d->ir_prg);
184 kfree(d->ir_prg); 184 kfree(d->it_prg);
185 185 kfree(d->buffer_status);
186 if (d->it_prg) 186 kfree(d->buffer_time);
187 kfree(d->it_prg); 187 kfree(d->last_used_cmd);
188 188 kfree(d->next_buffer);
189 if (d->buffer_status)
190 kfree(d->buffer_status);
191 if (d->buffer_time)
192 kfree(d->buffer_time);
193 if (d->last_used_cmd)
194 kfree(d->last_used_cmd);
195 if (d->next_buffer)
196 kfree(d->next_buffer);
197
198 list_del(&d->link); 189 list_del(&d->link);
199
200 kfree(d); 190 kfree(d);
201 191
202 return 0; 192 return 0;
@@ -1060,8 +1050,7 @@ static int __video1394_ioctl(struct file *file,
1060 PRINT(KERN_ERR, ohci->host->id, 1050 PRINT(KERN_ERR, ohci->host->id,
1061 "Buffer %d is already used",v.buffer); 1051 "Buffer %d is already used",v.buffer);
1062 spin_unlock_irqrestore(&d->lock,flags); 1052 spin_unlock_irqrestore(&d->lock,flags);
1063 if (psizes) 1053 kfree(psizes);
1064 kfree(psizes);
1065 return -EBUSY; 1054 return -EBUSY;
1066 } 1055 }
1067 1056
@@ -1116,9 +1105,7 @@ static int __video1394_ioctl(struct file *file,
1116 } 1105 }
1117 } 1106 }
1118 1107
1119 if (psizes) 1108 kfree(psizes);
1120 kfree(psizes);
1121
1122 return 0; 1109 return 0;
1123 1110
1124 } 1111 }