]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
[media] cx23885: fix pointer to structure for CAM
authorAnton Nurkin <ptqa@netup.ru>
Thu, 16 Aug 2012 13:55:40 +0000 (10:55 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 10 Sep 2012 14:53:50 +0000 (11:53 -0300)
Fixes problem with CAM, when  after re-iinitialization
CAM used old pointer to structure.

Signed-off-by: Anton Nurkin <ptqa@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/pci/cx23885/altera-ci.c

index 1fa8927f0d36eecb3946b7c7c48467eb3d540640..aee7f0dacff11a8a61764c274559bf5454909fad 100644 (file)
@@ -724,6 +724,7 @@ int altera_ci_init(struct altera_ci_config *config, int ci_nr)
        if (temp_int != NULL) {
                inter = temp_int->internal;
                (inter->cis_used)++;
+                inter->fpga_rw = config->fpga_rw;
                ci_dbg_print("%s: Find Internal Structure!\n", __func__);
        } else {
                inter = kzalloc(sizeof(struct fpga_internal), GFP_KERNEL);
@@ -743,7 +744,6 @@ int altera_ci_init(struct altera_ci_config *config, int ci_nr)
 
        ci_dbg_print("%s: setting state = %p for ci = %d\n", __func__,
                                                state, ci_nr - 1);
-       inter->state[ci_nr - 1] = state;
        state->internal = inter;
        state->nr = ci_nr - 1;
 
@@ -765,6 +765,8 @@ int altera_ci_init(struct altera_ci_config *config, int ci_nr)
        if (0 != ret)
                goto err;
 
+       inter->state[ci_nr - 1] = state;
+
        altera_hw_filt_init(config, ci_nr);
 
        if (inter->strt_wrk) {