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.0 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 D8C66C4363D for ; Wed, 23 Sep 2020 06:00:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 975E221924 for ; Wed, 23 Sep 2020 06:00:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600840834; bh=0WD7I6UcV56AxA+1Uu+EMnHocR9XoEEyN+zuHGn7uJg=; h=Subject:To:From:Date:List-ID:From; b=NIe8rEf86YwN+QEnSjpW535bfsG03MFZWo9Q+bTjwqtWLRkMNqfP+nQBpugVpSvAD /wDZKiBTYv1qSppTHcuDrXo2fRWS8bV+Jemfe/GW8v9SRl60LO9gP1yYuwoUtQr0g7 T5x0j5ka1w/yU6wSi0BxeNhxBOAHMBaK6Ir7t7eE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726608AbgIWGAd (ORCPT ); Wed, 23 Sep 2020 02:00:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:39352 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726179AbgIWGAd (ORCPT ); Wed, 23 Sep 2020 02:00:33 -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 EAD082068D; Wed, 23 Sep 2020 06:00:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600840832; bh=0WD7I6UcV56AxA+1Uu+EMnHocR9XoEEyN+zuHGn7uJg=; h=Subject:To:From:Date:From; b=oimj/senMgOnzhEY4GXhtYsiwYPBw5Nl/bvqN1mx7hkpdLL0lpfIoDQu69nl23as5 zZTYQuoY7Hdv7UpGL3gRa9Rf5e45hGJ/GpV6dIhI4MveRPZB4Q2b+Pk8Oqoyt9rzAP iadUHHqt6TZM0vBIvf7ErdMzKCvsnJ/XeNNkZ4zg= Subject: patch "iio:imu:st_lsm6dsx: check st_lsm6dsx_shub_read_output return" added to staging-next To: trix@redhat.com, Jonathan.Cameron@huawei.com, Stable@vger.kernel.org, andy.shevchenko@gmail.com From: Date: Wed, 23 Sep 2020 07:56:34 +0200 Message-ID: <160084059489116@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-next 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 also be merged in the next major kernel release during the merge window. 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