[PATCH 0/3] make ntfs_free() NULL safe

From: Jesper Juhl
Date: Fri Aug 19 2011 - 17:30:28 EST


Hi

Here's a small series of patches that make it safe to call ntfs_free()
with a NULL pointer and reaps some bennefits from that.

The first patch in the series simply makes ntfs_free() safe to call with a
NULL pointer. This fits with many other kernel freeing functions, that are
generally safe to call with NULL pointers.

The second patch adds some documentation to ntfs_free() similar to what's
already provided for the allocation functions. ntfs_free() is fairly
simple so you could argue that such documentation is not really needed,
but I say it's still nice to have if for no other reason than
completeness.

The third patch removes a number of tests for NULL pointers before calls
to ntfs_free() that patch 1 make redundant.

This whole things came about because Coverity Prevent spotted that in
fs/ntfs/runlist.c on line 967 we call ntfs_runlists_merge() which frees
its second argument and we then explicitly free that argument via
ntfs_free() again on line 970. This patch series also makes that a non
issue.


--
Jesper Juhl <jj@xxxxxxxxxxxxx> http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/