From: Artem Bityutskiy Date: Tue, 26 Oct 2010 21:23:07 +0000 (-0700) Subject: lib/list_sort: test: improve errors handling X-Git-Tag: v2.6.37-rc1~105^2~23 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3dc0e384248ea6fda0987f909007fa9ab5fb51a;p=pandora-kernel.git lib/list_sort: test: improve errors handling The 'lib_sort()' test does not free memory if it fails, and it makes the kernel panic if it cannot allocate memory. This patch fixes the problem. This patch also changes several small things: o use 'list_add()' helper instead of adding manually o introduce temporary 'el1' variable to avoid ugly and unreadalbe "if" statement o make 'head' to be stack variable instead of 'kmalloc()'ed, which simplifies code a bit Overall, this patch is of clean-up type. Signed-off-by: Artem Bityutskiy Cc: Don Mullis Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed