Commit fcbce05c authored by Federico Vaga's avatar Federico Vaga

kernel: fix mem leakage

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 68fac77a
......@@ -131,12 +131,7 @@ int fd_probe(struct fmc_device *fmc)
char *fwname;
int i, index, ret, ch;
fd = kzalloc(sizeof(*fd), GFP_KERNEL);
if (!fd) {
dev_err(dev, "can't allocate device\n");
return -ENOMEM;
}
/* Validate the new FMC device */
index = fmc->op->validate(fmc, &fd_drv);
if (index < 0) {
dev_info(dev, "not using \"%s\" according to "
......@@ -144,6 +139,12 @@ int fd_probe(struct fmc_device *fmc)
return -ENODEV;
}
fd = devm_kzalloc(&fmc->dev, sizeof(*fd), GFP_KERNEL);
if (!fd) {
dev_err(dev, "can't allocate device\n");
return -ENOMEM;
}
fwname = "";
if (!strcmp(fmc->carrier_name, "SVEC"))
......
......@@ -324,7 +324,7 @@ int fd_irq_init(struct fd_dev *fd)
if (rv < 0) {
dev_err(&fd->fmc->dev,
"Failed to request the VIC interrupt\n");
return rv;
goto out_irq_request;
}
/*
......@@ -344,6 +344,10 @@ int fd_irq_init(struct fd_dev *fd)
fd_writel(fd, FD_GCR_INPUT_EN, FD_REG_GCR);
return 0;
out_irq_request:
kfree(fd->sw_fifo.t);
return rv;
}
void fd_irq_exit(struct fd_dev *fd)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment