summaryrefslogtreecommitdiff
path: root/drivers/staging/dgap
diff options
context:
space:
mode:
authorDaeseok Youn <daeseok.youn@gmail.com>2014-06-02 14:06:53 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-06-19 15:21:47 -0700
commite74c2ddcbbc3ecfc55c246b3da3c5320fe46d8e3 (patch)
tree60c0da166f9a85fbfcd4fefddaaa52bd2cfc39a8 /drivers/staging/dgap
parentf86c55c9654da49d0bd401634cf679f410dfeb8d (diff)
downloadlwn-e74c2ddcbbc3ecfc55c246b3da3c5320fe46d8e3.tar.gz
lwn-e74c2ddcbbc3ecfc55c246b3da3c5320fe46d8e3.zip
staging: dgap: remove bogus null test in dgap_tty_init()
- The channels array were set to NULL in dgap_found_board(). - Removes redundant null check for channels array in for loop, if one of the channel cannot be allocated, dgap_tty_init() just returns an error. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/dgap')
-rw-r--r--drivers/staging/dgap/dgap.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index 5556a6ec8a12..fcfa061cb5e2 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -1379,12 +1379,10 @@ static int dgap_tty_init(struct board_t *brd)
* when the driver was first loaded.
*/
for (i = 0; i < brd->nasync; i++) {
- if (!brd->channels[i]) {
- brd->channels[i] =
- kzalloc(sizeof(struct channel_t), GFP_KERNEL);
- if (!brd->channels[i])
- return -ENOMEM;
- }
+ brd->channels[i] =
+ kzalloc(sizeof(struct channel_t), GFP_KERNEL);
+ if (!brd->channels[i])
+ return -ENOMEM;
}
ch = brd->channels[0];
@@ -1398,9 +1396,6 @@ static int dgap_tty_init(struct board_t *brd)
/* Set up channel variables */
for (i = 0; i < brd->nasync; i++, ch = brd->channels[i], bs++) {
- if (!brd->channels[i])
- continue;
-
spin_lock_init(&ch->ch_lock);
/* Store all our magic numbers */