netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tilman Schmidt <tilman@imap.cc>
To: davem@davemloft.net, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Cc: Hansjoerg Lipp <hjlipp@web.de>
Subject: [PATCH 3/8] gigaset: fix error return code
Date: Thu, 14 May 2009 00:44:17 +0200 (CEST)	[thread overview]
Message-ID: <20090514-patch-03.tilman@imap.cc> (raw)
In-Reply-To: <20090514-patch-00.tilman@imap.cc>

gigaset_register_to_LL() is expected to print a message and return 0
on failure. Make it do so consistently.

Impact: error handling bugfix
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
---
 drivers/isdn/gigaset/i4l.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/isdn/gigaset/i4l.c b/drivers/isdn/gigaset/i4l.c
index 69a702f..9b22f9c 100644
--- a/drivers/isdn/gigaset/i4l.c
+++ b/drivers/isdn/gigaset/i4l.c
@@ -544,11 +544,11 @@ int gigaset_register_to_LL(struct cardstate *cs, const char *isdnid)
 
 	gig_dbg(DEBUG_ANY, "Register driver capabilities to LL");
 
-	//iif->id[sizeof(iif->id) - 1]=0;
-	//strncpy(iif->id, isdnid, sizeof(iif->id) - 1);
 	if (snprintf(iif->id, sizeof iif->id, "%s_%u", isdnid, cs->minor_index)
-	    >= sizeof iif->id)
-		return -ENOMEM; //FIXME EINVAL/...??
+	    >= sizeof iif->id) {
+		pr_err("ID too long: %s\n", isdnid);
+		return 0;
+	}
 
 	iif->owner = THIS_MODULE;
 	iif->channels = cs->channels;
@@ -568,8 +568,10 @@ int gigaset_register_to_LL(struct cardstate *cs, const char *isdnid)
 	iif->rcvcallb_skb = NULL;		/* Will be set by LL */
 	iif->statcallb = NULL;			/* Will be set by LL */
 
-	if (!register_isdn(iif))
+	if (!register_isdn(iif)) {
+		pr_err("register_isdn failed\n");
 		return 0;
+	}
 
 	cs->myid = iif->channels;		/* Set my device id */
 	return 1;
-- 
1.6.2.1.214.ge986c


  reply	other threads:[~2009-05-13 22:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-13 22:44 [PATCH 0/8] Gigaset driver bugfixes and cleanups Tilman Schmidt
2009-05-13 22:44 ` Tilman Schmidt [this message]
2009-05-13 22:44 ` [PATCH 5/8] gigaset: remove obsolete references to m10x state table Tilman Schmidt
2009-05-13 22:44 ` [PATCH 1/8] gigaset: documentation update Tilman Schmidt
2009-05-13 22:44 ` [PATCH 2/8] gigaset: fix possible oops in error handling Tilman Schmidt
2009-05-13 22:44 ` [PATCH 4/8] gigaset: skip unnecessary hex formatting Tilman Schmidt
2009-05-13 22:44 ` [PATCH 6/8] gigaset: remove unused structure member rcvbytes Tilman Schmidt
2009-05-13 22:44 ` [PATCH 8/8] gigaset: move up Kconfig inclusion point Tilman Schmidt
2009-05-13 22:44 ` [PATCH 7/8] gigaset: remove UNDOCREQ config option Tilman Schmidt
2009-05-18  3:51 ` [PATCH 0/8] Gigaset driver bugfixes and cleanups David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090514-patch-03.tilman@imap.cc \
    --to=tilman@imap.cc \
    --cc=davem@davemloft.net \
    --cc=hjlipp@web.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).