37216381250920e1fb9c40c24b0daacc9065693f
[kernel-power] / kernel-power-2.6.28 / debian / patches / radio-bcm2048-security.patch
1 --- kernel-power-2.6.28.orig/drivers/media/radio/radio-bcm2048.c
2 +++ kernel-power-2.6.28/drivers/media/radio/radio-bcm2048.c
3 @@ -739,8 +739,7 @@ static int bcm2048_set_region(struct bcm
4                 return -EINVAL;
5  
6         mutex_lock(&bdev->mutex);
7 -       memcpy(&bdev->region_info, &region_configs[region],
8 -               sizeof(struct region_info));
9 +       bdev->region_info = region_configs[region];
10         mutex_unlock(&bdev->mutex);
11  
12         if (bdev->frequency < region_configs[region].bottom_frequency ||
13 @@ -1764,6 +1763,7 @@ static void bcm2048_rds_fifo_receive(str
14                                 bdev->rds_info.radio_text, bdev->fifo_size);
15         if (err != 2) {
16                 dev_err(&bdev->client->dev, "RDS Read problem\n");
17 +               mutex_unlock(&bdev->mutex);
18                 return;
19         }
20  
21 @@ -1979,7 +1979,7 @@ static ssize_t bcm2048_##prop##_read(str
22                                         char *buf)                      \
23  {                                                                      \
24         struct bcm2048_device *bdev = dev_get_drvdata(dev);             \
25 -       size value;                                                     \
26 +       int value;                                                      \
27                                                                         \
28         if (!bdev)                                                      \
29                 return -ENODEV;                                         \
30 @@ -2243,7 +2243,7 @@ static ssize_t bcm2048_fops_read(struct 
31                 if (copy_to_user(buf+i, tmpbuf, 3)) {
32                         retval = -EFAULT;
33                         break;
34 -               };
35 +               }
36                 i += 3;
37         }
38  
39 @@ -2350,7 +2350,7 @@ static int bcm2048_vidioc_queryctrl(stru
40  
41         for (i = 0; i < ARRAY_SIZE(bcm2048_v4l2_queryctrl); i++) {
42                 if (qc->id && qc->id == bcm2048_v4l2_queryctrl[i].id) {
43 -                       memcpy(qc, &(bcm2048_v4l2_queryctrl[i]), sizeof(*qc));
44 +                       *qc = bcm2048_v4l2_queryctrl[i];
45                         return 0;
46                 }
47         }
48 @@ -2621,8 +2621,7 @@ static int bcm2048_i2c_driver_probe(stru
49                 dev_dbg(&client->dev, "IRQ not configure. Using timeouts.\n");
50         }
51  
52 -       memcpy(bdev->videodev, &bcm2048_viddev_template,
53 -                       sizeof(bcm2048_viddev_template));
54 +       *bdev->videodev = bcm2048_viddev_template;
55         video_set_drvdata(bdev->videodev, bdev);
56         if (video_register_device(bdev->videodev, VFL_TYPE_RADIO, radio_nr)) {
57                 dev_dbg(&client->dev, "Could not register video device.\n");