Skip to content

Commit

Permalink
[PARISC] kfree cleanups to ioctl32.c
Browse files Browse the repository at this point in the history
2.6.12-rc2-pa2 kfree cleanups from Jesper Juhl

Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: Grant Grundler <grundler@parisc-linux.org>

Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
  • Loading branch information
Jesper Juhl authored and Kyle McMartin committed Oct 22, 2005
1 parent b8db800 commit c8e8b19
Showing 1 changed file with 9 additions and 23 deletions.
32 changes: 9 additions & 23 deletions arch/parisc/kernel/ioctl32.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,9 @@ static int drm32_version(unsigned int fd, unsigned int cmd, unsigned long arg)
}

out:
if (kversion.name)
kfree(kversion.name);
if (kversion.date)
kfree(kversion.date);
if (kversion.desc)
kfree(kversion.desc);
kfree(kversion.name);
kfree(kversion.date);
kfree(kversion.desc);
return ret;
}

Expand Down Expand Up @@ -166,9 +163,7 @@ static int drm32_getsetunique(unsigned int fd, unsigned int cmd, unsigned long a
ret = -EFAULT;
}

if (karg.unique != NULL)
kfree(karg.unique);

kfree(karg.unique);
return ret;
}

Expand Down Expand Up @@ -265,7 +260,6 @@ static int drm32_info_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
}

kfree(karg.list);

return ret;
}

Expand Down Expand Up @@ -305,7 +299,6 @@ static int drm32_free_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)

out:
kfree(karg.list);

return ret;
}

Expand Down Expand Up @@ -494,15 +487,10 @@ static int drm32_dma(unsigned int fd, unsigned int cmd, unsigned long arg)
}

out:
if (karg.send_indices)
kfree(karg.send_indices);
if (karg.send_sizes)
kfree(karg.send_sizes);
if (karg.request_indices)
kfree(karg.request_indices);
if (karg.request_sizes)
kfree(karg.request_sizes);

kfree(karg.send_indices);
kfree(karg.send_sizes);
kfree(karg.request_indices);
kfree(karg.request_sizes);
return ret;
}

Expand Down Expand Up @@ -555,9 +543,7 @@ static int drm32_res_ctx(unsigned int fd, unsigned int cmd, unsigned long arg)
ret = -EFAULT;
}

if (karg.contexts)
kfree(karg.contexts);

kfree(karg.contexts);
return ret;
}

Expand Down

0 comments on commit c8e8b19

Please sign in to comment.