Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp954062lqp; Thu, 23 May 2024 05:18:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXDe0QhjJJ7pNalakSl0MtvyYBvtwymxLqh5XGJohMWgxC5kGXVuu8/ftrFDrebvk0A+juhtf0ZXb8z6jvNkTmvqvmIcHLl2llK7w8/jg== X-Google-Smtp-Source: AGHT+IGN3jNojS71Ttcddlt0lOzOgFf8qN+tHohhIP0DC2euK/6AsZmewbaHYhuWlaP58wEDzbYG X-Received: by 2002:a17:902:8503:b0:1e7:eeb3:e295 with SMTP id d9443c01a7336-1f31ca3a30bmr43599735ad.69.1716466686574; Thu, 23 May 2024 05:18:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716466686; cv=pass; d=google.com; s=arc-20160816; b=McVfmYzDOBxvD33wLGVcWPPmAGuWSKjGYtmAm6H8WAETlSA6aLCkY7E3tp+dnAAxj5 aCbQwV/9qAq5URQt0ADkcXRVqHy1QXW7e3USnv43KFDih8cEMs0JPgs8ThxwjULiZv0d x6OdEyx7E+n0+zwUdAU+NutPEIuZu7fKZ2v4pRaxdma5DsQr8A3HNC6IRebVEdwKWd76 HP/Vp+xmMqO35tHk8NuaF4b1JWJdRcsI8qdMz9QOqG04LZOj80v+4+CJBIXy2PjohXcK G7dWsmkFPtioarJ/rcrZ0HmXQUe2AMBOBitd1mRlSQKEJKTQB8Zl/2VZoKzoeTSs4eJR Z+AQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:references:message-id:in-reply-to:subject:cc:to:from :date:dkim-signature; bh=VJ3uWhpkWfw1WUcM+Qm1iKLeNKAyAURnNvyiFaC04Os=; fh=LUt7no2sLUMTfafXX5zyDWY3djbG7TX84VaQGHiY8I4=; b=cwHn1zKmPswjA/yQva/20ZtiI4GZ71kFmFl0LBPfoyupyvEeoXSFmXwkhnLzj90Pj8 qjxtsDe1nTVJ0rRFJBTnqUfltZ0vJUeHu7wM0UlHjzNH//vnSTzlUewezAQgwKyz/rMw baUrwfOzbmPICrw2KGbP+Cb/+vCmfWq32amIUZx5cNn7NjId1xwpE/GFqYXpjtF4anlg qMwMymK7D9JsIcsbVca/u7cErXQ8N5o1MTrREdLBJKMGM4cpmpfZwJ87/w0oN82PpFxC lzpCfE0Rx5nDZVxtPVUn8ZfN/jLHlehYEsZjOr/M12E9nK2kab1szl/1c4JUvAHB2u9c MXBw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tkB7Q8tk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-187459-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187459-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0c0372b8si83116555ad.371.2024.05.23.05.18.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 05:18:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187459-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tkB7Q8tk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-187459-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187459-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id DEC992824F2 for ; Thu, 23 May 2024 12:18:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B5F4513E032; Thu, 23 May 2024 12:18:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tkB7Q8tk" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA6B91E4B3; Thu, 23 May 2024 12:17:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716466680; cv=none; b=g+IxmpA7AFsNBO/u60KUXxSUF8TzM4GQ12qPeZeIiJOgH9oUoev9JwS7HzCn64HbtOnQOMMFSwc3qZEM3HOWbLmxG3NHysATazKZaGvV4Wpr/SiQ+trMJ+/BUDgt9ihWnYzAIlQN+RLNYF5lSPxwrUDtd6r7en6mS+nMXPgA5ok= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716466680; c=relaxed/simple; bh=7aO37F9CiT6mvhwAwSHzC9znFgm9Bnyz4DIrdvAUdKA=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=ufIK2pmg52+Uqw7tZPYaQydiHukGiC4MMNJ0q3hXjbHCZwWj37OIjqSwYGJwRLqbgg6/02gYDFjjLR9LHiDTRgndFs77fNgWCp9jSRKejiO0VRzTbD8w2hTDo13E8mzB/SHyghMMpzZNkIJnDfSOHFVD17J2BaLXac9F0sP15hQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tkB7Q8tk; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3285C2BD10; Thu, 23 May 2024 12:17:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716466679; bh=7aO37F9CiT6mvhwAwSHzC9znFgm9Bnyz4DIrdvAUdKA=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=tkB7Q8tk3Lz6sRa7u6f7tGj44Cm9blizkajVawGuvum9IhxNpw51pcIfbAPlwdAIT AVrXkqJIRVj0/wEwgmo1tnNEu+L3FCyrRVQsiKHHrPP/BLdQP8IjyaXaooGZfDVZsC 7VcL9/DHrO74hCuL2Tvj6abQiRvaiAHpqLCrgMFBAMlGqo0YUql+8G8EqZtz6+G3uG hpXhvrkOoZVI8v6aKZXKUcJb1ESmFaFuDz52e7M6dAQ7vRAXVnW/wg+PGlGsE6PLit rvszT5EA+aPFHJoZ7GaI8VuGiXtHGqAHbj+h/Ok+m29oankEy3sbbH5IiwaXaNEQXQ pcQ2ZAO7L1k5Q== Date: Thu, 23 May 2024 14:17:56 +0200 (CEST) From: Jiri Kosina To: Chen Ni cc: rrameshbabu@nvidia.com, bentiss@kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] HID: nvidia-shield: Add missing check for input_ff_create_memless In-Reply-To: <20240515033051.2693390-1-nichen@iscas.ac.cn> Message-ID: References: <20240515033051.2693390-1-nichen@iscas.ac.cn> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII On Wed, 15 May 2024, Chen Ni wrote: > 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; > Applied, thanks. -- Jiri Kosina SUSE Labs