From patchwork Mon Jan 12 12:43:17 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Bolle X-Patchwork-Id: 17922 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 9E851DE134 for ; Mon, 12 Jan 2009 23:43:27 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751316AbZALMnV (ORCPT ); Mon, 12 Jan 2009 07:43:21 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751185AbZALMnV (ORCPT ); Mon, 12 Jan 2009 07:43:21 -0500 Received: from smtp-out3.tiscali.nl ([195.241.79.178]:45684 "EHLO smtp-out3.tiscali.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750907AbZALMnU (ORCPT ); Mon, 12 Jan 2009 07:43:20 -0500 X-Greylist: delayed 339 seconds by postgrey-1.27 at vger.kernel.org; Mon, 12 Jan 2009 07:43:20 EST Received: from [212.123.169.34] (helo=[192.168.1.42]) by smtp-out3.tiscali.nl with esmtp id 1LMM8U-0006Dk-Ct for ; Mon, 12 Jan 2009 13:43:18 +0100 Subject: [i4l] do not print a warning when shutting down an i4l ppp interface From: Paul Bolle To: netdev@vger.kernel.org Date: Mon, 12 Jan 2009 13:43:17 +0100 Message-Id: <1231764197.7132.12.camel@test.thuisdomein> Mime-Version: 1.0 X-Mailer: Evolution 2.25.4 (2.25.4-1.fc11) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org When an i4l ppp interface is shut down (e.g. with /sbin/ifdown ippp0) a scary warning is logged: isdn_free_channel: called with invalid drv(-1) or channel(-1) This warning is caused by isdn_net_unbind_channel(), which always calls isdn_free_channel() even if isdn_net_local->isdn_device and isdn_net_local->isdn_channel are (still) in a perfectly acceptable default state, so let's not do that. Signed-off-by: Paul Bolle --- Sent only to netdev@vger.kernel.org (and not also to isdn4linux@listserv.isdn4linux.de) because an earlier ISDN patch I wrote only got a response from this list (and this patch is NETWORKING related anyway). --- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c index ecc92c8..cb8943d 100644 --- a/drivers/isdn/i4l/isdn_net.c +++ b/drivers/isdn/i4l/isdn_net.c @@ -292,7 +292,9 @@ isdn_net_unbind_channel(isdn_net_local * lp) lp->dialstate = 0; dev->rx_netdev[isdn_dc2minor(lp->isdn_device, lp->isdn_channel)] = NULL; dev->st_netdev[isdn_dc2minor(lp->isdn_device, lp->isdn_channel)] = NULL; - isdn_free_channel(lp->isdn_device, lp->isdn_channel, ISDN_USAGE_NET); + if (lp->isdn_device != -1 && lp->isdn_channel != -1) + isdn_free_channel(lp->isdn_device, lp->isdn_channel, + ISDN_USAGE_NET); lp->flags &= ~ISDN_NET_CONNECTED; lp->isdn_device = -1; lp->isdn_channel = -1;