Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1076715pxu; Wed, 6 Jan 2021 11:36:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJyqnCs/ASPinZHTfuCpyqvrWk+Tx7QcRX4bT4vioiUc9Lc5xSnv93NDtJGUKhXd/yh8AkTg X-Received: by 2002:a17:907:3e02:: with SMTP id hp2mr2286640ejc.411.1609961770440; Wed, 06 Jan 2021 11:36:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609961770; cv=none; d=google.com; s=arc-20160816; b=Y4L6Wt2wsi2ySCmsCFNtkJVvxhf+CscfYmtSN/hONsWz51c5t/L+QQT4DloggFhsqG fOsyHYeFp1ToA02THLSteApgD6d5ny5NrX/yq27U4fEuefQI++lY+hgllAd8/NDZmJFz AQJdojyS6/2aPdDXRyHred1DilWH+pHz6VLc4yhm404Zp0GH3toHLxVlzbzx5boc6TWm sSIwpRYbwT9xmoNlxdSBfmhK+5TpmB8/oAA/mktQbGLH8xu3pc9Dci0uscZJ1lIwzw34 BGKY5uqBdg11UxvuIvehcFA9ap7KCA/IOgXS6dBmKRViDDvtD4tgLSj9vttqnNobFE+R Fb2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=LKX+v411qJTSzQmb+cGxJEJkOBIOhcRhlSFMC+/Hg1k=; b=NzR46ROT10jVTUlBuGRT+sd2lbZVaKN2jtLMb0+O0BP2Z6UH1mDXbba+fMXcS8Wq2U ftOYcsDj0h5NyCA0pyH5URbe9phzKNrmE4wpZBmt0G139N2FXpgCiqlofOx3JLsNs2uw w9Egm7Aab30YBaf8UL3D7MhJVpL5Mmcj4OVE4vlUSYbufqs9SSmHMznP+drGJ+jqQdhm p0hSNUVI37CxYNT6tIXaNetHl0Wckvbvx9o6Qr0AbD+HY9iYfdxhi1poLENY6ZkMpBzW WY+7pdJz5TaOTyBtL7B8M5w7TUFKSeUMttmagqFisKbWGJ1/LiORzCrp5TlBPlO3zxcU u8wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=jqjUbeXc; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn6si1204407ejc.234.2021.01.06.11.35.46; Wed, 06 Jan 2021 11:36:10 -0800 (PST) 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=@oracle.com header.s=corp-2020-01-29 header.b=jqjUbeXc; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727126AbhAFTcZ (ORCPT + 99 others); Wed, 6 Jan 2021 14:32:25 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:50926 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725822AbhAFTcY (ORCPT ); Wed, 6 Jan 2021 14:32:24 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 106JSv4x096316; Wed, 6 Jan 2021 19:31:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=LKX+v411qJTSzQmb+cGxJEJkOBIOhcRhlSFMC+/Hg1k=; b=jqjUbeXc/xNjQSXYN3ogeUGIbB7rFX1hPcU2tEsbE49Cg6NdNxP6ALf1V+PKDwneEemk FdwOcfUmT1DBXWfn1vQ06W/DoKADh8Zm+ebH4P7mpHueLXkgwk4eAwMc0MrLNvTDL5zY cXcTRLlB1pwNrtk5VX9wPsKe7s9erfIa2LoQegRtuj9F25lU8U3LWizXdakIHmgM/kvm C0TDmZbCKMg018oUC08XjOoFtACknDu6BFSz8XlUxV2NAQ7Z8/3rFXE8YVLSJ0ufe9c8 HN3tC/VVhYbH77LIsadSCJ7O+cEtRgxG2YMDK08i8dY67Dba1gO57/fQtekkmqjLABzb tg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 35wepm9h4p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 06 Jan 2021 19:31:30 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 106JUchj071415; Wed, 6 Jan 2021 19:31:29 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 35w3qsed49-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 06 Jan 2021 19:31:29 +0000 Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 106JVQCp018580; Wed, 6 Jan 2021 19:31:26 GMT Received: from kadam (/102.36.221.92) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 06 Jan 2021 11:31:25 -0800 Date: Wed, 6 Jan 2021 22:31:16 +0300 From: Dan Carpenter To: Alan Stern , Hans Verkuil Cc: Antoine Jacquet , Andy Shevchenko , Mauro Carvalho Chehab , linux-usb@vger.kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] media: zr364xx: fix memory leaks in probe() Message-ID: <20210106193116.GE2831@kadam> References: <20210106164550.GB1012582@rowland.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210106164550.GB1012582@rowland.harvard.edu> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9856 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 mlxscore=0 spamscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101060109 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9856 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 spamscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 mlxscore=0 malwarescore=0 clxscore=1011 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101060109 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 06, 2021 at 11:45:50AM -0500, Alan Stern wrote: > On Wed, Jan 06, 2021 at 01:10:05PM +0300, Dan Carpenter wrote: > > Syzbot discovered that the probe error handling doesn't clean up the > > resources allocated in zr364xx_board_init(). There are several > > related bugs in this code so I have re-written the error handling. > > Dan: > > I recently sent in a patch for a similar problem in the gspca driver > (commit e469d0b09a19 "media: gspca: Fix memory leak in probe"). It > seems there may be similar issues in that driver: one single function > call tries to undo an indeterminate number of initializations. > > I don't know enough about these subsystems to evaluate this. Can you > take a look at it? > The probe error handling in gspca_dev_probe2() is fine now. All those functions are no-ops when they haven't been allocated/registered. regards, dan carpenter