Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp3869643ima; Mon, 4 Feb 2019 06:34:49 -0800 (PST) X-Google-Smtp-Source: AHgI3IZmmYIaAcZzNpKMcPWOJmYLoJlQrlYor1MjDJBCp5EZ13FaTRlh8uKruy3fQItiE+EZ/OfT X-Received: by 2002:a17:902:834b:: with SMTP id z11mr373294pln.151.1549290889470; Mon, 04 Feb 2019 06:34:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549290889; cv=none; d=google.com; s=arc-20160816; b=A+qj0lru3mqtrVuUKDkbGOk0qXFXj5FAgkdfU5azyTM1S2uRDfDKSvfo4LqjXTJERf 8XSmXF71ZJIs/warQzaYEu1gXCHjmknBxyayzGYxTzQRZJY5XuUWh5NqUq5WjlgEdDUc yTB4dtW73+wVsqZJ0loSdYDiSpbotw9ipsZ7BUpDzwV7kYEybKp5xyj86irMjAJgAewF eclaAgmS+X9GahwNVCoImiKrwLWs/7X8kl4woL4wbrVpvtzwOwHYBnlkNpKJnOrzlexO 4F0EWu1bKUV79l60tPEA/aNNbYAAylaMUl3RnfcputX+qSICB0CyGaeq9rTvoBuEGcOc 5unA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=prtZ45xt2aEyDhjyUlQFwRiM5Jm5Jx5m4mwAeOjL+P0=; b=bqzjhZed22gdauvdMicpfpjoYhtXDav9xjt6X7Swqw7yB84Y+xfpHmLywkuaMBX03r pPjGAPKV5SA+iaQEmH3bVmjcb2zFe679D7kqpYoSPGduNGchQTiUNKBvEhBmA1/tzO2I /cD9C1EeKJz0fLS0GnUIrh6R0dpiwG0eEXlLe+eROX1eHrFgsLgHxTHaE7M8fghF6ILi IA7xiQDCvCVL9FkUvL9TnWkMBVRm576UaCtwBO+6yiiXWCg+NZkzhqCEHso8i6HUqVvH LxaKkexNftA/U0qwFqRy1AIEhYYii/BAMVYff39IMGpmJhhURRkahgUyHbjU5GfV5sak 0f6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si140956pgn.502.2019.02.04.06.34.33; Mon, 04 Feb 2019 06:34:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731461AbfBDN5H (ORCPT + 99 others); Mon, 4 Feb 2019 08:57:07 -0500 Received: from mx2.suse.de ([195.135.220.15]:35760 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731441AbfBDN5G (ORCPT ); Mon, 4 Feb 2019 08:57:06 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id A780BADC8; Mon, 4 Feb 2019 13:57:05 +0000 (UTC) From: Petr Mladek To: Jiri Kosina , Josh Poimboeuf , Miroslav Benes Cc: Jason Baron , Joe Lawrence , Evgenii Shatokhin , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Petr Mladek Subject: [PATCH v2 2/4] livepatch: return -ENOMEM on ptr_id() allocation failure Date: Mon, 4 Feb 2019 14:56:51 +0100 Message-Id: <20190204135653.31406-3-pmladek@suse.com> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20190204135653.31406-1-pmladek@suse.com> References: <20190204135653.31406-1-pmladek@suse.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joe Lawrence Fixes the following smatch warning: lib/livepatch/test_klp_shadow_vars.c:47 ptr_id() warn: returning -1 instead of -ENOMEM is sloppy Signed-off-by: Joe Lawrence Signed-off-by: Petr Mladek --- lib/livepatch/test_klp_shadow_vars.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/livepatch/test_klp_shadow_vars.c b/lib/livepatch/test_klp_shadow_vars.c index 02f892f941dc..f5441c193166 100644 --- a/lib/livepatch/test_klp_shadow_vars.c +++ b/lib/livepatch/test_klp_shadow_vars.c @@ -44,7 +44,7 @@ static int ptr_id(void *ptr) sp = kmalloc(sizeof(*sp), GFP_ATOMIC); if (!sp) - return -1; + return -ENOMEM; sp->ptr = ptr; sp->id = count++; -- 2.13.7