Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp747076pxy; Wed, 5 May 2021 12:52:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjYFjvgp0ocIgBt3gtXHMidoJyUmc+PCqjUHyiszrndE7EJs0BryUBcNl5tGpWHXAK8f7m X-Received: by 2002:a17:90a:f2d3:: with SMTP id gt19mr13333515pjb.52.1620244343731; Wed, 05 May 2021 12:52:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620244343; cv=none; d=google.com; s=arc-20160816; b=v69RkqrJSebBGQJrASNPfbtD21U6FvZcHQhAC+dM/Vd9hreHPIT1QAon03iQDXfVsD D6+DHl1O5DIsg4ZQsc9N8R78ja1xZug/M4EoqVJq5y+AoGYfrETRmPoadzBSvlh0qHti 1/daP9H4gDl6S8aSocLpjq28cWWDxxFXjJvRmFUp1YCx8L/EUdeKWSdExAnjBCU2RVNV HWED6P3/+tNPur7f8ey0XGBR3ujhvWzLiwAKsm4+oat9JaIj37Seqinz25E/SBQntb3p Utl1gNpnLLLDFynUCtlCQm7D4cCYW2PGYW122dAUab6yA8OCVNl2kfpS2umKAdX1MOyX 7ing== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=sT5gh+1EXZtOxYM3WBIR7U/7xjEHkvX592kGUagqFYc=; b=GxzuzbsUj2L0S0nJHo7YFDrlveGhtsvGrcVjDv2M4k7o6O96B51IiUaejWXrL89fTV 5PcX5dUhgwHC7lRc8XW+EGfOtvb3LTmRwPwi41JytCH9nm+zJOV8foOOB8kxIwR92l1r 49ABSd9Qe4MJhbsN9HS2uKCfNeyKSb04/tUKb4jLpkTmnSF+hDdp+tjgkosTVWXbiy0D 5hElMr+/ls/kQz/db4HBrnN+9h1G3UD/5fCySFzegMFY9lgI9dmkXHytggKVSeXyQ36i yDu1ePwOwfVkeYwWPazyb4osG0XHrGN3xoFkENLOynIzoVZKxlaHL5jj+1dOVLwRdjgL 6CXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=aRbgNk1A; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w9si8389182pjq.114.2021.05.05.12.52.09; Wed, 05 May 2021 12:52:23 -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=@linuxfoundation.org header.s=google header.b=aRbgNk1A; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233666AbhEEPzU (ORCPT + 99 others); Wed, 5 May 2021 11:55:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233594AbhEEPzT (ORCPT ); Wed, 5 May 2021 11:55:19 -0400 Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 483F7C061574 for ; Wed, 5 May 2021 08:54:23 -0700 (PDT) Received: by mail-qk1-x72d.google.com with SMTP id 76so1937324qkn.13 for ; Wed, 05 May 2021 08:54:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=sT5gh+1EXZtOxYM3WBIR7U/7xjEHkvX592kGUagqFYc=; b=aRbgNk1AAtCgn3aq1pldMwpcsbLLO0vsA9yDCYjTSKGDjhuIZGtGBhKlW5hu2kUzU2 VyxCj0mryiV8DsfB5b12qFz7DnauvSNwG5QkejFlCxMOzJcV9Og+67chd5p/plYHT+Z+ mL6Yh1T/OFD98MRBkPTueajHVg9CJBxWMeMSM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=sT5gh+1EXZtOxYM3WBIR7U/7xjEHkvX592kGUagqFYc=; b=mIAFm5lJlnBUiXGkn512UkLRIbXdK2d1HTHrCCHmUoOlufTKP3MqkZRYvshgZht9aK bFuOSxaRjFTbDCAIx1MavJhY96MktmiGHGrvtVctM6wXI3B+oK2ffi98GnUGaPcHZF7r 7Nz0qkjUti+AF1iR8unDnT/jIoCDU7FPeRksmZFxSMIzK8879kSQAgk5fJZ9oDqQQgCu 7vx1+hSrWFVRfLcxyyeYkPD1eSXw/B2Q6WW1yBH/sJauwi4geu7fygsV1fESX1CeA+50 htCvzLKB33JHbiWbm+ncjmFUIXsPKwinYT1NjNx+shOjfTCXK46SmXWWsnOtQfDkavfa ZyHw== X-Gm-Message-State: AOAM5301KA/BHeArS0S4hIMlt6LPwYqeYUSRpFv/LQ38kFLxfXM9p7Bq MzpdI50sTBfWVvHAv+zx4fPITA== X-Received: by 2002:a05:620a:15ca:: with SMTP id o10mr2987351qkm.448.1620230062521; Wed, 05 May 2021 08:54:22 -0700 (PDT) Received: from [192.168.151.33] (50-232-25-43-static.hfc.comcastbusiness.net. [50.232.25.43]) by smtp.gmail.com with ESMTPSA id k126sm7664937qkb.30.2021.05.05.08.54.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 May 2021 08:54:22 -0700 (PDT) Subject: Re: [PATCH v2] media: em28xx: Fix possible memory leak of em28xx struct To: Igor Matheus Andrade Torrente , mchehab@kernel.org, hverkuil-cisco@xs4all.nl Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan References: <20210504183249.6307-1-igormtorrente@gmail.com> From: Shuah Khan Message-ID: <21f59c86-f1ae-5913-cde9-078fe4f6f752@linuxfoundation.org> Date: Wed, 5 May 2021 11:54:20 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210504183249.6307-1-igormtorrente@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/4/21 2:32 PM, Igor Matheus Andrade Torrente wrote: > The em28xx struct kref isn't being decreased after an error in the > em28xx_ir_init, leading to a possible memory leak. > > A kref_put and em28xx_shutdown_buttons is added to the error handler code. > > Signed-off-by: Igor Matheus Andrade Torrente > --- Hi Igor, Please look at Hans's response and comments to your v1 patch. v4l core addresses the lifetime issues now and this driver could be updated to use them instead if fixing the problems in this driver's resource lifetime mgmt code. Please follow his review comments to address the issue based on his suggestions. thanks, -- Shuah