Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756109AbeAIMm0 (ORCPT + 1 other); Tue, 9 Jan 2018 07:42:26 -0500 Received: from mout.web.de ([212.227.15.4]:55535 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752165AbeAIMmY (ORCPT ); Tue, 9 Jan 2018 07:42:24 -0500 To: kernel-janitors@vger.kernel.org, Arnd Bergmann , Greg Kroah-Hartman , Kees Cook Cc: LKML From: SF Markus Elfring Subject: [PATCH] misc/lkdtm_usercopy: Delete an error message for a failed memory allocation in do_usercopy_heap_whitelist() Message-ID: <4e1e5a7a-3c92-24b3-18fc-081638ad083a@users.sourceforge.net> Date: Tue, 9 Jan 2018 13:42:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:gKCegGrLBZquKATCP8vOxvZG2OH84A7/ZMoWPSe9Tz+TS5e6ool OJnTwbFIA4W6ic17jD3UKekBoD2obSwYfty7b20/QSzY5uYjo4GlIFZeZfaJWTTi+o7G4F5 6+asg699yGvYGJKPs+enjyyif0BSzbrse+BrUGKaOii+JP8JfqO11h5Q9OXzc3a0nXnLosJ H+V7uK4nW+/sGzv5NBYQQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:VOF1umGYwi0=:WFK1GDnp4Isea+tBoJWI8k atoA7fz9yN0Te+X65Tc9bbY0oiQIqWFKZOxFRguaLkUnfXvNQylB0oM9cPPyqcAGLUZK5u7w2 XrlSMYEpkVDEmi1mxuVv6T4rLW8y03xe/xwavEGOIPUEFc4jfEHsi3bjo5PxzglqiMdZyhF1A 1I2DMIp9MHpFou8BGnEvFAzflBedG3/ja6SWvx/+zurOm0/86gpqWRLylgE6Vex1Q4dm3PXiO HCSt5r5yqoPX+0OMktUEwaU8sj4GIagUhJ32UZeAlwlDDgWF65iwrEIpye7CnjnWkzSUaOXOx 2/kEP15HBLkjPjY3me+OERDYdF04LfwIFz8ykSJjNEDp1LaNNFDkQhypxX322VzEiV2m4zGrd JNneo4FvTuPUn2G10UkU1b8uUF+aCinkcK/wtpp4d5cqbiABcupEx/i4jux7uIr55iWRak7y3 arxdT4kbfrxHS5yGs6e8yulKYGh10p1xae1cGs9Wc7xumdLh7YP45/y4HXvGLnhQhK9H3d2sq nQZRFmFqGELqGawKKhHcDjs3eGVhcsK5vyXuuVmkX88qkv4PIT9xUVnC+fkZsqS2CGGeXYc6l KfGsO37+MvjK9bq1zgs9FSs3URl9JhpkihEesOwLH7B5B0YnFH9QqeQvNi1TQi9b/ZVbW+H73 kTt6udK1Ih8edmQ59r1JeuHmkWMSVh398yuHbEy7CVBcGPgL0E21BN61pm9xNYcSeCj967Mba rDIv3ga6RFgwngBommugSK/6yH6tAtZI/XuarKiZUPOSiBQzJWUt81pudekj3r/8kZk21LRx6 0+ncjiGWO8PX+SgwUzfH2dqf/4iD2wUOaCeRYyMQMn3a3QhKqA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Markus Elfring Date: Tue, 9 Jan 2018 13:31:43 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/misc/lkdtm_usercopy.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/misc/lkdtm_usercopy.c b/drivers/misc/lkdtm_usercopy.c index 9725aed305bb..ed50c1db4f87 100644 --- a/drivers/misc/lkdtm_usercopy.c +++ b/drivers/misc/lkdtm_usercopy.c @@ -202,10 +202,8 @@ static void do_usercopy_heap_whitelist(bool to_user) * Allocate a buffer with a whitelisted window in the buffer. */ buf = kmem_cache_alloc(whitelist_cache, GFP_KERNEL); - if (!buf) { - pr_warn("Failed to allocate buffer from whitelist cache\n"); + if (!buf) goto free_alloc; - } /* Allocate user memory we'll poke at. */ user_alloc = vm_mmap(NULL, 0, PAGE_SIZE, -- 2.15.1