netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: santosh nayak <santoshprasadnayak@gmail.com>
To: hjlipp@web.de
Cc: tilman@imap.cc, isdn@linux-pingi.de,
	gigaset307x-common@lists.sourceforge.net, netdev@vger.kernel.org,
	linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Santosh Nayak <santoshprasadnayak@gmail.com>
Subject: [PATCH] isdn: Return -EINTR in gigaset_start() if locking attempts fails.
Date: Fri, 16 Mar 2012 18:40:13 +0530	[thread overview]
Message-ID: <1331903413-11426-1-git-send-email-santoshprasadnayak@gmail.com> (raw)

From: Santosh Nayak <santoshprasadnayak@gmail.com>

If locking attempt was interrupted by a signal then we should
return -EINTR so that caller can take appropriate action.

We have 3 callers: gigaset_probe(), gigaset_tty_open() and
gigaset_probe(). Each caller tries to free allocated memory
if lock fails. This is possible if we returns -EINTR.

Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com>
---
 drivers/isdn/gigaset/common.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
index 7679270..2d10f3a 100644
--- a/drivers/isdn/gigaset/common.c
+++ b/drivers/isdn/gigaset/common.c
@@ -903,7 +903,7 @@ int gigaset_start(struct cardstate *cs)
 	unsigned long flags;
 
 	if (mutex_lock_interruptible(&cs->mutex))
-		return 0;
+		return -EINTR;
 
 	spin_lock_irqsave(&cs->lock, flags);
 	cs->connected = 1;
-- 
1.7.4.4

             reply	other threads:[~2012-03-16 13:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-16 13:10 santosh nayak [this message]
2012-03-17  6:18 ` [PATCH] isdn: Return -EINTR in gigaset_start() if locking attempts fails David Miller
2012-03-17 15:56   ` santosh prasad nayak
2012-03-17 20:58     ` David Miller
2012-03-17 21:28       ` Julia Lawall
2012-03-17 10:31 ` Tilman Schmidt

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=1331903413-11426-1-git-send-email-santoshprasadnayak@gmail.com \
    --to=santoshprasadnayak@gmail.com \
    --cc=gigaset307x-common@lists.sourceforge.net \
    --cc=hjlipp@web.de \
    --cc=isdn@linux-pingi.de \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tilman@imap.cc \
    /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).