Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp583174pxj; Thu, 13 May 2021 11:49:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxXGhzMOyA8fwLpefcTWvU20xjrmew3mhVfcJK6NZPaE/nSKKHcYHrAabPR5HRrE21v+1Pi X-Received: by 2002:a05:6808:655:: with SMTP id z21mr4017952oih.8.1620931764365; Thu, 13 May 2021 11:49:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620931764; cv=none; d=google.com; s=arc-20160816; b=zZ2mCjrHqOlv//yUn3DTJriy2qcjwIqB0n5J4oa+NgnaInaSLL7EuarmBpsomj25tI CpFoerwHbefpttO+Sp56K0jAPMzkEt4LJGdo443zSnxNZ9qy9fZK8UX1t95UMVKRhppd qvTp7Hrv+sf1i0t8A69hzL41yeEjI5hHHYuXx7V43qWHcUNB1yi7YjYKDubZeVJaMeaO PmgQl5UfOcfGxTHtsXj1hs3c5EWFpngwKSALyDi9oY46yLtcDuxpqlvJoDZZB05NeAUJ MQEaHW9LJ+PNVAl1CdkaY+AUw0KTsQw+d+3+j6eNOQoOiZlkim+mkqaQYExAAyYIOk/M GLaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=35/cfvn/wjqpJWMlVt8Y5Y61RUMFcR4/AC6ooJ38jp0=; b=d5u4orMSYNNlf7mbbsY9tSWA+g7MNbwlwZaod97ajhaT0xSkNdWHck4egBtGT+c1WI PBOFqpBk5XJh5+3Qs6nQM0hKSPspLr5FgbANs9ffONLjW6a4uN4EWf3BLmYw7zeAAbTU ahf7za/4iOjR2uVYnBpAOUn4RpEbLLXGx3o7A1Skq4E/yWf3ew0aVAr7ftY+05zpacgR +cl7u5G1ST/Ec7fF59b3VAcMkIv9CQUSKXxlTwKzuvrJhGAo+DVvnjf/R2OXMZ88dNcz KpSX7HTHIhv5ruL/ambeW8Q2rJOLmkx6U/3ITzBctpbKHLNvAFJiZuq+9QPaLJbGK+DD iZyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M1wGDTMK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n20si3621259oop.54.2021.05.13.11.49.10; Thu, 13 May 2021 11:49:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M1wGDTMK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233183AbhEMLKU (ORCPT + 99 others); Thu, 13 May 2021 07:10:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:59774 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232957AbhEMLKR (ORCPT ); Thu, 13 May 2021 07:10:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D47CA61422; Thu, 13 May 2021 11:09:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620904148; bh=uoluFBaduD5lLVV4XzN00NtHyh9peG4uBDHAHqnWv8o=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=M1wGDTMKy1JRRL4gmij6N2CDAmH/WNMowt8QqCeFvj1GA88YVvXSxqRhM4cCEnrdq 8aC4N3MvF7e6MZd2xAJkSqPp2tI2PDgwUMW81v9Xxgi2SoTi58cJLuOnslYZXqIu3q 9im0/s4exVXCQciNOfNZmjRe/1/njdMeP73nmHvTV61QdeZO4R55p38NfMmr0H4iKl 98xBUKRNjWQKPS3/nhysSswwwD0L7H1xXeBNIq8PX1hD/Y/BwjwTTCWvvxTOhXkR9R jdeKLVWaRD5Bup9p+FkCqjbfSyRcc2ax8fsq6xUjfoIW92h9OlI4sflBSDjxYeEKfR IWzHRz9iqP/KQ== Date: Thu, 13 May 2021 13:09:04 +0200 (CEST) From: Jiri Kosina To: Michael Zaidman cc: trix@redhat.com, benjamin.tissoires@redhat.com, linux-i2c@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4] HID: ft260: improve error handling of ft260_hid_feature_report_get() In-Reply-To: <20210511101208.16401-1-michael.zaidman@gmail.com> Message-ID: References: <20210511101208.16401-1-michael.zaidman@gmail.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 11 May 2021, Michael Zaidman wrote: > Fixes: 6a82582d9fa4 ("HID: ft260: add usb hid to i2c host bridge driver") > > The ft260_hid_feature_report_get() checks if the return size matches > the requested size. But the function can also fail with at least -ENOMEM. > Add the < 0 checks. > > In ft260_hid_feature_report_get(), do not do the memcpy to the caller's > buffer if there is an error. > > --- > v4 Fixed commit message > --- > v3 Simplify and optimize the changes > --- > v2: add unlikely()'s for error conditions > --- > > Signed-off-by: Tom Rix > Signed-off-by: Michael Zaidman Who should be the author of the git commit? Thanks, -- Jiri Kosina SUSE Labs