Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754672AbeAGVCd (ORCPT + 1 other); Sun, 7 Jan 2018 16:02:33 -0500 Received: from mout.web.de ([212.227.15.4]:57501 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750965AbeAGVCb (ORCPT ); Sun, 7 Jan 2018 16:02:31 -0500 Subject: [PATCH 1/2] misc/apds9802als: Delete an error message for a failed memory allocation in apds9802als_probe() From: SF Markus Elfring To: kernel-janitors@vger.kernel.org, Arnd Bergmann , Greg Kroah-Hartman Cc: LKML References: Message-ID: <501c9715-0f40-7365-07e9-23201f8f540b@users.sourceforge.net> Date: Sun, 7 Jan 2018 22:02:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:GF4hx3ELUKcqMihGAi30+IvR4Tf94lO45tlx8g4klYUiTujyTfR 38BzC7STKE5oZvV1HgxDzAlO3FzIpcpjEvaES3vAYTv2Pt8Vcs7/Hlnghw9GTgp3OYD2j0U G2DYpbcOtL0iKFYIs15VlTcU90LF5DlgL+vAMjE5MZL+h5Dc5m3qCbHiqrbxLpqXqM4Opqr FHcy1ySekBX9EABU4iRXA== X-UI-Out-Filterresults: notjunk:1;V01:K0:PbVcj+UVZ7g=:MPfdz5NRgP1LBA091UMkQf 3kJ132Jh0tSuiYheiEvffQc2pQXKSR96Bmgi5ksB+AB4cStscSWMxJkimtP04TOmf67xzsYdY f6iN1IIMgN7fowWlleP/0LELRmiR5NtuKtRTY7QlM45EVhHAfex78AySnfHX2KP5srELYmRtP sUOedsWmn/CQ0my4HkaodJQP2p8s7t7jpJnWYjQDx3WQbmGsKwaETq5s7g5ngKbj/XmD8T8H4 IRY4JcpN8AKmjUWUgY7uYc+StApWtD2/l6lET+HlSWyLR/AIjYu9bp94Zzp9SIJ2fxE5PdghK mmEqYZ3ZsqgIAtLeEpLGyf+OL/v2W1Jy3wflFGnFgXQRg69FpRXdIXJHgh4DJ7Ljv/VU2a8zR yUkiS8/W7ZCJ7/S6Ozs5MW9PlzSHXJ6sCqq/hGYEwf/8Kxdv16k6uwJfrj72puLdYAS/Hk8af v0FvUmxcFwICyf7Ujvq7NvBuZiEiu/vw5Q9RL77gdTzlAzj4Jsqv0YLDMav48HOvxF6UTWb3z pql8hH+wsJ+AuMJNYfAEM8N+P24h3IvfmK1yN1BNoFEDWVadsvDGyx0YmfoFsnaPW9WOSEa6h FjHEpcXbCYT+YFEjlSgDvOXdq4qoDfGODsO+z/xkn+h3qq9DE8nVvJvr3p7Nbz1HFJIQgsrsI xXuMX2ujh2TxIvzNAurKo80W/qwMvT7Q+f6dxg2+WwKiR8S8+Ynkx0xLHaoPXUOgHynzqvYAb 2R5yiPFJE6ZiwQ1F4L94e/Ot3TMBWI56AjZ1E6MrD6GSnY4GxLR8S7n0QFBh4fiEB6Ya42TCR Q+nvbRIE9RlFdLnx1+ZTdOh3w2wjIJ3aKVsVcXs3BJfCLW4+t8= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Markus Elfring Date: Sun, 7 Jan 2018 21:42:07 +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/apds9802als.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/misc/apds9802als.c b/drivers/misc/apds9802als.c index d8ac036f01ab..fa548796c92e 100644 --- a/drivers/misc/apds9802als.c +++ b/drivers/misc/apds9802als.c @@ -231,10 +231,9 @@ static int apds9802als_probe(struct i2c_client *client, struct als_data *data; data = kzalloc(sizeof(struct als_data), GFP_KERNEL); - if (data == NULL) { - dev_err(&client->dev, "Memory allocation failed\n"); + if (!data) return -ENOMEM; - } + i2c_set_clientdata(client, data); res = sysfs_create_group(&client->dev.kobj, &m_als_gr); if (res) { -- 2.15.1