Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp381838pxk; Thu, 3 Sep 2020 02:08:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyU1bq5MTdq6Z1ayeNayineKS3+dHxPwddNUcmw779NmpCniX/dYdH+0nkLvTdNrzcB62bE X-Received: by 2002:a50:d54b:: with SMTP id f11mr1959773edj.329.1599124107891; Thu, 03 Sep 2020 02:08:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599124107; cv=none; d=google.com; s=arc-20160816; b=tvLdhS1wwy8WSUN8+46ELJRjXJlJNxHp1Wflmm0GFqVPP6kP8Ij502FH38KxFVaRiz h4b/5hjyOfA9SEDJXNOf2l5seqSP88OxqMKOq3sycJL77356JI3qHOXKMXnVt6lXJROy +P2f+o8u3ulp7CdoU7xpLyDyvJlOX6weiMPtwZcU5uDYc/8xUWuqG888crZg1By1BXiA Ry0rqUPBeg9Zbp+elbx8OmE9sNwCegymXD5XPn8+nlVGLDSlNyFfan2PEgKXufu5dwzo 2abxnqAt78r/6D0udcfbeM5B6JCpT9It3myJcAP8aRiYqN/Y/afIDuQAE619cW3B53BA 7s0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=owh6ENOfZLiKkr6a8aENWo0SEmnmRTESwVJvZpaq8m0=; b=iX/WZi1mhcpiUJZSIA91ToxNdewcgYJoFfqNjQLiMv4WOR3hHU0TfNsMTcxzgzoFdh kD4yQ6B9Jfqn2Ixrp3O2g01BrJQGcMixtJku0NiRgN0RB/uplUEM5bX5EAQp8IcWavvF IhoI7Q+j1ZayU9OrWA+oYCL2rkbZI9BqMTvcLt/JcZNGnZDI0EvLHso0pi6j2blOyPuZ O5B9gRXQkxA5T21CJ4OTx50M8qr3zOeS3Z55Wnyajg/9QE0S3e9hbKR3U11Dh0aDhoMn k6kUcVYun+qYzbFndRQxlV03/E2lxCLiKzHYOeAaD+MSzChCLQStsjLkC8RJCcJiYG7i exfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vARd3doW; 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 ld12si1470145ejb.329.2020.09.03.02.08.04; Thu, 03 Sep 2020 02:08:27 -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=default header.b=vARd3doW; 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 S1728150AbgICJFO (ORCPT + 99 others); Thu, 3 Sep 2020 05:05:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:55294 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726448AbgICJFO (ORCPT ); Thu, 3 Sep 2020 05:05:14 -0400 Received: from coco.lan (ip5f5ad5c3.dynamic.kabel-deutschland.de [95.90.213.195]) (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 5A9A420709; Thu, 3 Sep 2020 09:05:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599123913; bh=5msA1CmDUNZg69tLz8pFJJct70UtAz65Z8gc9Hz522Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=vARd3doWYponZSo39/iKi+4VNVuDBqVDqZHKfZxm5KnfH9q2yzQouuWtjDwBwv3Mo 5R6Uf76TdoB+PDWYTLMsEShH6G2r5QTgBUIE7ozJoZfJjQl16Uz4gsg/MTWv8fsdfa 2N6X43s9q5DFrh91F3VVW/0Nmlw0ADX1eTcVu9Ao= Date: Thu, 3 Sep 2020 11:05:09 +0200 From: Mauro Carvalho Chehab To: Andy Shevchenko Cc: Colin King , Sakari Ailus , Greg Kroah-Hartman , Linus Walleij , Linux Media Mailing List , "open list:STAGING SUBSYSTEM" , kernel-janitors@vger.kernel.org, Linux Kernel Mailing List Subject: Re: [PATCH][next] staging: media: atomisp: fix memory leak of object flash Message-ID: <20200903110509.4542cdad@coco.lan> In-Reply-To: References: <20200902165852.201155-1-colin.king@canonical.com> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, 2 Sep 2020 21:15:31 +0300 Andy Shevchenko escreveu: > On Wed, Sep 2, 2020 at 8:02 PM Colin King wrote: > > > > From: Colin Ian King > > > > In the case where the call to lm3554_platform_data_func returns an > > error there is a memory leak on the error return path of object > > flash. Fix this by adding an error return path that will free > > flash and rename labels fail2 to fail3 and fail1 to fail2. > > > > Wouldn't be proper fix to move to devm_kmalloc() and return > dev_err_probe() where appropriate? Actually, we prefer not using devm_*() at media subsystem. Once we started migrating alloc stuff to use it. We end needing to revert those, as it caused side effects related to lifecycle management: some object were de-allocating too late. Others with multiple interfaces (USB, pci) had even worse troubles. Thanks, Mauro