diff options
Diffstat (limited to 'drivers/media/pci/cx23885/altera-ci.c')
| -rw-r--r-- | drivers/media/pci/cx23885/altera-ci.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/media/pci/cx23885/altera-ci.c b/drivers/media/pci/cx23885/altera-ci.c index 5c94e312cba3..0dc348215b72 100644 --- a/drivers/media/pci/cx23885/altera-ci.c +++ b/drivers/media/pci/cx23885/altera-ci.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * altera-ci.c * @@ -5,17 +6,6 @@ * * Copyright (C) 2010,2011 NetUP Inc. * Copyright (C) 2010,2011 Igor M. Liplianin <liplianin@netup.ru> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * - * GNU General Public License for more details. */ /* @@ -51,10 +41,10 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -#include <dvb_demux.h> -#include <dvb_frontend.h> +#include <media/dvb_demux.h> +#include <media/dvb_frontend.h> #include "altera-ci.h" -#include "dvb_ca_en50221.h" +#include <media/dvb_ca_en50221.h> /* FPGA regs */ #define NETUP_CI_INT_CTRL 0x00 @@ -346,7 +336,7 @@ static int altera_ci_slot_reset(struct dvb_ca_en50221 *en50221, int slot) mutex_unlock(&inter->fpga_mutex); for (;;) { - mdelay(50); + msleep(50); mutex_lock(&inter->fpga_mutex); @@ -665,6 +655,10 @@ static int altera_hw_filt_init(struct altera_ci_config *config, int hw_filt_nr) } temp_int = append_internal(inter); + if (!temp_int) { + ret = -ENOMEM; + goto err; + } inter->filts_used = 1; inter->dev = config->dev; inter->fpga_rw = config->fpga_rw; @@ -699,6 +693,7 @@ err: __func__, ret); kfree(pid_filt); + kfree(inter); return ret; } @@ -733,6 +728,10 @@ int altera_ci_init(struct altera_ci_config *config, int ci_nr) } temp_int = append_internal(inter); + if (!temp_int) { + ret = -ENOMEM; + goto err; + } inter->cis_used = 1; inter->dev = config->dev; inter->fpga_rw = config->fpga_rw; @@ -801,6 +800,7 @@ err: ci_dbg_print("%s: Cannot initialize CI: Error %d.\n", __func__, ret); kfree(state); + kfree(inter); return ret; } |
