Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp3066757lqo; Tue, 14 May 2024 20:31:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU+U92Qp3sUfPOcLY97s1BVq+IcdGhL6Z7c1T+TJ6o/3wO/pBiALq1U54ETAMHiVget6aQnHRQEkWMd7BtawnM9a37rS91NQFQt+ctuRg== X-Google-Smtp-Source: AGHT+IEd9J+453ibx+mXJBHsCRPurfR3QFFTPIRVVN8B+f6n+OJSnbpW4cQQijwsdMkw3PCqonio X-Received: by 2002:a05:6402:2801:b0:572:aed3:a1b1 with SMTP id 4fb4d7f45d1cf-5733294b485mr18671728a12.17.1715743906111; Tue, 14 May 2024 20:31:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715743906; cv=pass; d=google.com; s=arc-20160816; b=Fejsxn3uY61SnfqSxWBwXitM995OtpjxZRR896huLHLdu+mv0w8HpUGv9OjXYblBzX lTurLEkcJHkTJw75pjGIX0dR0GBcD+HW0L7g2WkdE/KmjBXJ4wq7XlQ6hKB0F1MnzVOM XEzwQjoBqnR6jcT+mdyZVJI7hp/sQWezPGlRfbyuV6PJzg2ru3jMVCv7pAcHDjvpIAKi GY6PEzGGTDuSRKGRcvhdY/qFyaH8a75HcMa3cEKcd08CnUGSWSlj6cpF7Ak/ScisB+1d ONIV+YukKdBVfkFGCL0/jrLljDP9cgdwj7h+oQL/ZIrzDhqpAMGNsrrh8ayHC/zp0SVl kCbw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=w4nM+hwEgy2G9U4PowR6OpFUa54RAltheZetidIaq78=; fh=GnxRGTVAFIlIz0CmuiuvWw+IqYH3KkdejeT3WZgD2mQ=; b=BZV0d0jCWOtYEnoeAcQnvwZIakd/+n6/VVu6KJNukZiUvXoq2WF1ESshAFiBpO/fyg /B3/y7eSYZrCC946w7fspHZhaM1UkBmVlJ84GUyNbcA2sPnZyt4SlDPbQhDVAcu3rX0s avvi1OHGEmYBNBuBZY/CwlmL9eKFmlWUjLO/fsIt2uCtM71IEyXuogTHFGavxVMJDUOS zo3AsdH6LIWWPuu9Y3pHot6773Vc65J9gyOoavGVCjg6+UmDuR3CIfSktnZfruW7/gFo xDNAKIuT9BP7/Th1Iena43n4vvSBe6c7QhTQad/ErnNEK1JZFkHohOAf81sYylwSVzy0 Um9A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=iscas.ac.cn); spf=pass (google.com: domain of linux-kernel+bounces-179373-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179373-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c2e3d2dsi7198219a12.313.2024.05.14.20.31.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 May 2024 20:31:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-179373-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=iscas.ac.cn); spf=pass (google.com: domain of linux-kernel+bounces-179373-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-179373-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D617F1F21B00 for ; Wed, 15 May 2024 03:31:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42F59381AA; Wed, 15 May 2024 03:31:38 +0000 (UTC) Received: from cstnet.cn (smtp84.cstnet.cn [159.226.251.84]) (using TLSv1.2 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DAC233998; Wed, 15 May 2024 03:31:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.226.251.84 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715743897; cv=none; b=gcc5QXNLKcdnritd6ZhiCn0C3BbfTuBHQKurQDR7l4Rqzrq7puf0gLlwWr/MVa+mbmUtzIQcVBz1mBQnhUSZC0TkUsnNOuzpbO5bpYY3vFkF5EXxNWABr+A5cGsAmxMhnuiPiIuyoWp1tw+p22UU5xOcsRHHMTKkoxzg9+2f0vo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715743897; c=relaxed/simple; bh=GJnhp0nIlkpaw2pXsx815X3mkKAsAEMrxdQGpI8uPIo=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=pDZOVJwNziNeRxaBuXswspkWaRMK+E/ZWTRHBmlz5yMRe04dmcwIrz/bGYQm3Qh+Uy/ndp9LLhGhZKYw5vOvdEPsXx3a/v09/WDFg9maZYpStzB6/107RXqunqAFS9+FcN2ZoNlATkDN9Na0N36TfyIkcLs5rMIvURxq9tDmRKw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iscas.ac.cn; spf=pass smtp.mailfrom=iscas.ac.cn; arc=none smtp.client-ip=159.226.251.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=iscas.ac.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iscas.ac.cn Received: from localhost (unknown [124.16.138.129]) by APP-05 (Coremail) with SMTP id zQCowAAnLACLLERmZKZACw--.9681S2; Wed, 15 May 2024 11:31:23 +0800 (CST) From: Chen Ni To: rrameshbabu@nvidia.com, jikos@kernel.org, bentiss@kernel.org Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Chen Ni Subject: [PATCH] HID: nvidia-shield: Add missing check for input_ff_create_memless Date: Wed, 15 May 2024 11:30:51 +0800 Message-Id: <20240515033051.2693390-1-nichen@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID:zQCowAAnLACLLERmZKZACw--.9681S2 X-Coremail-Antispam: 1UD129KBjvdXoWrKr4rJryDJw4rtryfGF48WFg_yoW3Kwb_Kr W0ganxWr4UKwnakrnrJr4fAFyIvayYqFWfXr1vqr4ayry29wsxX3yjgrnxG34UCa4jqa4r Kw4rGr1fArsIkjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbc8FF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_Gr0_Xr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_ Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AKxVWxJr 0_GcWle2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E 2Ix0cI8IcVAFwI0_JrI_JrylYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7xkEbVWUJV W8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lc2xSY4AK67AK6r48 MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr 0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0E wIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJV W8JwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAI cVC2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIevJa73UjIFyTuYvjfUnpnQUUUUU X-CM-SenderInfo: xqlfxv3q6l2u1dvotugofq/ Add check for the return value of input_ff_create_memless() and return the error if it fails in order to catch the error. Signed-off-by: Chen Ni --- drivers/hid/hid-nvidia-shield.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/hid/hid-nvidia-shield.c b/drivers/hid/hid-nvidia-shield.c index 58b15750dbb0..ff9078ad1961 100644 --- a/drivers/hid/hid-nvidia-shield.c +++ b/drivers/hid/hid-nvidia-shield.c @@ -283,7 +283,9 @@ static struct input_dev *shield_haptics_create( return haptics; input_set_capability(haptics, EV_FF, FF_RUMBLE); - input_ff_create_memless(haptics, NULL, play_effect); + ret = input_ff_create_memless(haptics, NULL, play_effect); + if (ret) + goto err; ret = input_register_device(haptics); if (ret) -- 2.25.1