Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 205547
b: refs/heads/master
c: 668f272
h: refs/heads/master
i:
  205545: ed3396f
  205543: d0bd45c
v: v3
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Jun 17, 2010
1 parent c9f5950 commit fbd7ff6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fa3b5d9ab0487f58b45d55a37070aa0d417f59d5
refs/heads/master: 668f272e57e80ece987bed273096f8e3a707123c
44 changes: 23 additions & 21 deletions trunk/drivers/staging/comedi/drivers/serial2002.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,30 +412,25 @@ static int serial_2002_open(struct comedi_device *dev)
int max;
};

struct config_t dig_in_config[32];
struct config_t dig_out_config[32];
struct config_t chan_in_config[32];
struct config_t chan_out_config[32];
struct config_t *dig_in_config;
struct config_t *dig_out_config;
struct config_t *chan_in_config;
struct config_t *chan_out_config;
int i;

result = 0;
for (i = 0; i < 32; i++) {
dig_in_config[i].kind = 0;
dig_in_config[i].bits = 0;
dig_in_config[i].min = 0;
dig_in_config[i].max = 0;
dig_out_config[i].kind = 0;
dig_out_config[i].bits = 0;
dig_out_config[i].min = 0;
dig_out_config[i].max = 0;
chan_in_config[i].kind = 0;
chan_in_config[i].bits = 0;
chan_in_config[i].min = 0;
chan_in_config[i].max = 0;
chan_out_config[i].kind = 0;
chan_out_config[i].bits = 0;
chan_out_config[i].min = 0;
chan_out_config[i].max = 0;
dig_in_config = kcalloc(32, sizeof(struct config_t),
GFP_KERNEL);
dig_out_config = kcalloc(32, sizeof(struct config_t),
GFP_KERNEL);
chan_in_config = kcalloc(32, sizeof(struct config_t),
GFP_KERNEL);
chan_out_config = kcalloc(32, sizeof(struct config_t),
GFP_KERNEL);
if (!dig_in_config || !dig_out_config
|| !chan_in_config || !chan_out_config) {
result = -ENOMEM;
goto err_alloc_configs;
}

tty_setspeed(devpriv->tty, devpriv->speed);
Expand Down Expand Up @@ -690,6 +685,13 @@ static int serial_2002_open(struct comedi_device *dev)
s->range_table_list = NULL;
}
}

err_alloc_configs:
kfree(dig_in_config);
kfree(dig_out_config);
kfree(chan_in_config);
kfree(chan_out_config);

if (result) {
if (devpriv->tty) {
filp_close(devpriv->tty, 0);
Expand Down

0 comments on commit fbd7ff6

Please sign in to comment.