summaryrefslogtreecommitdiff
path: root/drivers/gpib/cec/cec_gpib.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpib/cec/cec_gpib.c')
-rw-r--r--drivers/gpib/cec/cec_gpib.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/gpib/cec/cec_gpib.c b/drivers/gpib/cec/cec_gpib.c
index dbf9b95baabc..7e57d65d6c32 100644
--- a/drivers/gpib/cec/cec_gpib.c
+++ b/drivers/gpib/cec/cec_gpib.c
@@ -220,11 +220,10 @@ static int cec_allocate_private(struct gpib_board *board)
{
struct cec_priv *priv;
- board->private_data = kmalloc(sizeof(struct cec_priv), GFP_KERNEL);
+ board->private_data = kzalloc(sizeof(struct cec_priv), GFP_KERNEL);
if (!board->private_data)
- return -1;
+ return -ENOMEM;
priv = board->private_data;
- memset(priv, 0, sizeof(struct cec_priv));
init_nec7210_private(&priv->nec7210_priv);
return 0;
}
@@ -239,11 +238,13 @@ static int cec_generic_attach(struct gpib_board *board)
{
struct cec_priv *cec_priv;
struct nec7210_priv *nec_priv;
+ int retval;
board->status = 0;
- if (cec_allocate_private(board))
- return -ENOMEM;
+ retval = cec_allocate_private(board);
+ if (retval)
+ return retval;
cec_priv = board->private_data;
nec_priv = &cec_priv->nec7210_priv;
nec_priv->read_byte = nec7210_ioport_read_byte;