Message ID | 20210315135210.609231437@linuxfoundation.org |
---|---|
State | New |
Headers | show
Return-Path: <stable-owner@kernel.org> 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=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 7A77EC2BA19 for <stable@archiver.kernel.org>; Mon, 15 Mar 2021 13:55:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 36E4A64EF3 for <stable@archiver.kernel.org>; Mon, 15 Mar 2021 13:55:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231516AbhCONzW (ORCPT <rfc822;stable@archiver.kernel.org>); Mon, 15 Mar 2021 09:55:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:58978 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229696AbhCONys (ORCPT <rfc822;stable@vger.kernel.org>); Mon, 15 Mar 2021 09:54:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EAE4E64DAD; Mon, 15 Mar 2021 13:54:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816487; bh=l69FUftW8NIve7NEWCJlehUULKtIpdKpxh9a8jGzzag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HBqo0K3yR3ohCB63Y8tgESBdjOX570CssOtyG3Ov2+e7U7QO8QvSrGsXojsrKNsW6 nEr0LSc9aTMmtuYkpbZClImh6UFYVL69YicAp7iq65pp4FX0ty8P4lbxuuenojNvQH OV1c2h4p4PeLuS3vqc5tm+iUi5BVt2mZrEAeEn8c= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Navid Emamdoost <navid.emamdoost@gmail.com>, Alexandru Ardelean <alexandru.ardelean@analog.com>, Jonathan Cameron <Jonathan.Cameron@huawei.com>, Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Subject: [PATCH 4.4 72/75] iio: imu: adis16400: fix memory leak Date: Mon, 15 Mar 2021 14:52:26 +0100 Message-Id: <20210315135210.609231437@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135208.252034256@linuxfoundation.org> References: <20210315135208.252034256@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
--- a/drivers/iio/imu/adis16400_buffer.c +++ b/drivers/iio/imu/adis16400_buffer.c @@ -37,8 +37,11 @@ int adis16400_update_scan_mode(struct ii return -ENOMEM; adis->buffer = kzalloc(burst_length + sizeof(u16), GFP_KERNEL); - if (!adis->buffer) + if (!adis->buffer) { + kfree(adis->xfer); + adis->xfer = NULL; return -ENOMEM; + } tx = adis->buffer + burst_length; tx[0] = ADIS_READ_REG(ADIS16400_GLOB_CMD);