From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0412DC2D0E2 for ; Tue, 22 Sep 2020 07:54:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A657823A61 for ; Tue, 22 Sep 2020 07:54:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600761282; bh=Cpw4FzHuT0u/aX1n8C53pQ/D7ix5UoFDNxIBRKg9xhg=; h=Subject:To:From:Date:List-ID:From; b=Uhs8xEfTYzqXS5l4EQVJOX/ZSh3ovpKBnY49s3cHxdHAkpUAJh/sPfxiY6rDswwZm s+TZcN2q0HnvXAymbtqTC7jumpmL/yQZ2cr6y4UlhxUN87ECovVRYIpL64IRTVP4jV Gu4QFEwQxZNnbD2Q20k+Ql0jDwZyd2FaSwAL3uaM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726723AbgIVHym (ORCPT ); Tue, 22 Sep 2020 03:54:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:52874 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726442AbgIVHym (ORCPT ); Tue, 22 Sep 2020 03:54:42 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7E06A23A5F; Tue, 22 Sep 2020 07:54:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600761281; bh=Cpw4FzHuT0u/aX1n8C53pQ/D7ix5UoFDNxIBRKg9xhg=; h=Subject:To:From:Date:From; b=vCzPDSBD56wLr6ZyHfy6IJj6yzWQVkWA0FicqnCNcAZ7IsAL+jqsPZNkcg6erqKbi JhSQRd7ElRmJr2QmZAqrsbTbcdNkPm0r36QWZZNskTip6LVp/1uYS1HVSSsvvJRP1F pXwjtQ6+e0YfZVvJA67NWhi4dhBRBgxzBfdEDySs= Subject: patch "iio:imu:st_lsm6dsx: check st_lsm6dsx_shub_read_output return" added to staging-testing To: trix@redhat.com, Jonathan.Cameron@huawei.com, Stable@vger.kernel.org, andy.shevchenko@gmail.com From: Date: Tue, 22 Sep 2020 09:47:45 +0200 Message-ID: <16007608656381@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is a note to let you know that I've just added the patch titled iio:imu:st_lsm6dsx: check st_lsm6dsx_shub_read_output return to my staging git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git in the staging-testing branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will be merged to the staging-next branch sometime soon, after it passes testing, and the merge window is open. If you have any questions about this process, please let me know. >From f71e41e23e129640f620b65fc362a6da02580310 Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Sun, 9 Aug 2020 10:55:51 -0700 Subject: iio:imu:st_lsm6dsx: check st_lsm6dsx_shub_read_output return Potential error return is not checked. This can lead to use of undefined data. Detected by clang static analysis. st_lsm6dsx_shub.c:540:8: warning: Assigned value is garbage or undefined *val = (s16)le16_to_cpu(*((__le16 *)data)); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: c91c1c844ebd ("iio: imu: st_lsm6dsx: add i2c embedded controller support") Signed-off-by: Tom Rix Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200809175551.6794-1-trix@redhat.com Signed-off-by: Jonathan Cameron --- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c index ed83471dc7dd..8c8d8870ca07 100644 --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c @@ -313,6 +313,8 @@ st_lsm6dsx_shub_read(struct st_lsm6dsx_sensor *sensor, u8 addr, err = st_lsm6dsx_shub_read_output(hw, data, len & ST_LS6DSX_READ_OP_MASK); + if (err < 0) + return err; st_lsm6dsx_shub_master_enable(sensor, false); -- 2.28.0