[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <6781d6ac8e6deac9eb1778a287c6f2f71a4d65f7.1455570595.git.pebolle@tiscali.nl>
Date: Mon, 15 Feb 2016 22:30:39 +0100
From: Paul Bolle <pebolle@...cali.nl>
To: Dmitry Vyukov <dvyukov@...gle.com>
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] ser_gigaset: bail out if gigaset_initcs() fails
The first substantial thing that ser_gigaset's open() operation does, is
calling gigaset_initcs(). That function is well behaved: if it fails it
cleans up after itself and returns NULL. So if we receive a NULL here we
might as well bail out directly. (Note that both the bas_gigaset driver
and the usb_gigaset driver already do that.)
Besides, in the error path tty->disc_data will be set to NULL. But
tty->disc_data hasn't been touched yet, so there's no reason to set it
to NULL.
Not-yet-signed-off-by: Paul Bolle <pebolle@...cali.nl>
---
drivers/isdn/gigaset/ser-gigaset.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c
index 2a506fe0c8a4..ae69ab89c5c0 100644
--- a/drivers/isdn/gigaset/ser-gigaset.c
+++ b/drivers/isdn/gigaset/ser-gigaset.c
@@ -514,10 +514,8 @@ gigaset_tty_open(struct tty_struct *tty)
/* allocate memory for our device state and initialize it */
cs = gigaset_initcs(driver, 1, 1, 0, cidmode, GIGASET_MODULENAME);
- if (!cs) {
- rc = -ENODEV;
- goto error;
- }
+ if (!cs)
+ return -ENODEV;
cs->dev = &cs->hw.ser->dev.dev;
cs->hw.ser->tty = tty;
--
2.4.3
Powered by blists - more mailing lists