diff options
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0021-cx25821-Remove-bad-strcpy-to-read-only-char.patch')
-rw-r--r-- | recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0021-cx25821-Remove-bad-strcpy-to-read-only-char.patch | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0021-cx25821-Remove-bad-strcpy-to-read-only-char.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0021-cx25821-Remove-bad-strcpy-to-read-only-char.patch new file mode 100644 index 00000000..bc425dc8 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0021-cx25821-Remove-bad-strcpy-to-read-only-char.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From 030eee1110a4bb7e4bce1cb32eb0f1a4fbd9923a Mon Sep 17 00:00:00 2001 | ||
2 | From: Ezequiel Garcia <elezegarcia@gmail.com> | ||
3 | Date: Wed, 18 Jul 2012 10:05:26 -0300 | ||
4 | Subject: [PATCH 21/73] cx25821: Remove bad strcpy to read-only char* | ||
5 | |||
6 | commit 380e99fc44d79bc35af9ff1d3316ef4027ce775e upstream. | ||
7 | |||
8 | The strcpy was being used to set the name of the board. Since the | ||
9 | destination char* was read-only and the name is set statically at | ||
10 | compile time; this was both wrong and redundant. | ||
11 | |||
12 | The type of char* is changed to const char* to prevent future errors. | ||
13 | |||
14 | Reported-by: Radek Masin <radek@masin.eu> | ||
15 | Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com> | ||
16 | [ Taking directly due to vacations - Linus ] | ||
17 | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> | ||
18 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
19 | --- | ||
20 | drivers/media/video/cx25821/cx25821-core.c | 3 --- | ||
21 | drivers/media/video/cx25821/cx25821.h | 2 +- | ||
22 | 2 files changed, 1 insertions(+), 4 deletions(-) | ||
23 | |||
24 | diff --git a/drivers/media/video/cx25821/cx25821-core.c b/drivers/media/video/cx25821/cx25821-core.c | ||
25 | index a7fa38f..e572ce5 100644 | ||
26 | --- a/drivers/media/video/cx25821/cx25821-core.c | ||
27 | +++ b/drivers/media/video/cx25821/cx25821-core.c | ||
28 | @@ -914,9 +914,6 @@ static int cx25821_dev_setup(struct cx25821_dev *dev) | ||
29 | list_add_tail(&dev->devlist, &cx25821_devlist); | ||
30 | mutex_unlock(&cx25821_devlist_mutex); | ||
31 | |||
32 | - strcpy(cx25821_boards[UNKNOWN_BOARD].name, "unknown"); | ||
33 | - strcpy(cx25821_boards[CX25821_BOARD].name, "cx25821"); | ||
34 | - | ||
35 | if (dev->pci->device != 0x8210) { | ||
36 | pr_info("%s(): Exiting. Incorrect Hardware device = 0x%02x\n", | ||
37 | __func__, dev->pci->device); | ||
38 | diff --git a/drivers/media/video/cx25821/cx25821.h b/drivers/media/video/cx25821/cx25821.h | ||
39 | index 2d2d009..bf54360 100644 | ||
40 | --- a/drivers/media/video/cx25821/cx25821.h | ||
41 | +++ b/drivers/media/video/cx25821/cx25821.h | ||
42 | @@ -187,7 +187,7 @@ enum port { | ||
43 | }; | ||
44 | |||
45 | struct cx25821_board { | ||
46 | - char *name; | ||
47 | + const char *name; | ||
48 | enum port porta; | ||
49 | enum port portb; | ||
50 | enum port portc; | ||
51 | -- | ||
52 | 1.7.7.6 | ||
53 | |||