From f3dc0e384248ea6fda0987f909007fa9ab5fb51a Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Tue, 26 Oct 2010 14:23:07 -0700 Subject: [PATCH] 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-format-patch failed