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=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 1362AC282CA for ; Sun, 27 Jan 2019 20:30:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DF47F2133F for ; Sun, 27 Jan 2019 20:30:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727147AbfA0Uat convert rfc822-to-8bit (ORCPT ); Sun, 27 Jan 2019 15:30:49 -0500 Received: from smtp-prod05.osg.ufl.edu ([128.227.74.125]:45764 "EHLO smtp.ufl.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726630AbfA0Uat (ORCPT ); Sun, 27 Jan 2019 15:30:49 -0500 X-UFL-GatorLink-Authenticated: authenticated as () with from 10.36.197.39 Received: from exmbxprd18.ad.ufl.edu ([10.36.197.39]) by smtp.ufl.edu (8.14.4/8.14.4/3.0.0) with ESMTP id x0RKUdHQ011525 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sun, 27 Jan 2019 15:30:40 -0500 Received: from exmbxprd18.ad.ufl.edu (10.36.197.39) by exmbxprd18.ad.ufl.edu (10.36.197.39) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sun, 27 Jan 2019 15:30:39 -0500 Received: from exmbxprd18.ad.ufl.edu ([fe80::890c:cba5:27b2:db27]) by exmbxprd18.ad.ufl.edu ([fe80::890c:cba5:27b2:db27%19]) with mapi id 15.00.1395.000; Sun, 27 Jan 2019 15:30:39 -0500 From: "Yavuz, Tuba" To: Andrew Lunn CC: Greg KH , "netdev@vger.kernel.org" , "davem@davemloft.net" Subject: Re: Error in the hso driver Thread-Topic: Error in the hso driver Thread-Index: AQHUtm5pVVhb5FrhFEau5tLNmcMsFKXD1cCA//+wMaKAAFw0AP//rsC/ Date: Sun, 27 Jan 2019 20:30:38 +0000 Message-ID: <1548621038338.92496@ece.ufl.edu> References: <1548614320825.86428@ece.ufl.edu> <20190127193503.GC25051@kroah.com> <1548618592071.43193@ece.ufl.edu>,<20190127201924.GA32046@lunn.ch> In-Reply-To: <20190127201924.GA32046@lunn.ch> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.36.198.14] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-27_14:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901270166 X-UFL-Spam-Level: * Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org I agree and it would be much easier to track cleanup operations. I think this is happening because probe function calls hso_create_net_device, which performs the cleaning. The driver may need some revision to achieve cleanup inside the probe, Best, Tuba Yavuz, Ph.D. Assistant Professor Electrical and Computer Engineering Department University of Florida Gainesville, FL 32611 Webpage: http://www.tuba.ece.ufl.edu/ Email: tuba@ece.ufl.edu Phone: (352) 846 0202 ________________________________________ From: Andrew Lunn Sent: Sunday, January 27, 2019 3:19 PM To: Yavuz, Tuba Cc: Greg KH; netdev@vger.kernel.org; davem@davemloft.net Subject: Re: Error in the hso driver On Sun, Jan 27, 2019 at 07:49:52PM +0000, Yavuz, Tuba wrote: > Here is a proposed patch: > > --- drivers/net/usb/hso.c.orig 2019-01-27 14:45:58.232683119 -0500 > +++ drivers/net/usb/hso.c 2019-01-27 14:47:43.592683629 -0500 > @@ -2377,7 +2377,7 @@ static void hso_free_net_device(struct h > > remove_net_device(hso_net->parent); > > - if (hso_net->net) > + if (hso_net->net && hso_net->net->reg_state == NETREG_REGISTERED) > unregister_netdev(hso_net->net); > > /* start freeing */ Hi Tuba Using the free function from the probe often has problems. It is better to put the cleanup at the end of the probe, and use a collection of goto's and labels. Andrew