summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.25/0021-cx25821-Remove-bad-strcpy-to-read-only-char.patch
diff options
context:
space:
mode:
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.patch53
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 @@
1From 030eee1110a4bb7e4bce1cb32eb0f1a4fbd9923a Mon Sep 17 00:00:00 2001
2From: Ezequiel Garcia <elezegarcia@gmail.com>
3Date: Wed, 18 Jul 2012 10:05:26 -0300
4Subject: [PATCH 21/73] cx25821: Remove bad strcpy to read-only char*
5
6commit 380e99fc44d79bc35af9ff1d3316ef4027ce775e upstream.
7
8The strcpy was being used to set the name of the board. Since the
9destination char* was read-only and the name is set statically at
10compile time; this was both wrong and redundant.
11
12The type of char* is changed to const char* to prevent future errors.
13
14Reported-by: Radek Masin <radek@masin.eu>
15Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
16[ Taking directly due to vacations - Linus ]
17Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
18Signed-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
24diff --git a/drivers/media/video/cx25821/cx25821-core.c b/drivers/media/video/cx25821/cx25821-core.c
25index 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);
38diff --git a/drivers/media/video/cx25821/cx25821.h b/drivers/media/video/cx25821/cx25821.h
39index 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--
521.7.7.6
53