diff options
Diffstat (limited to 'meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch')
-rw-r--r-- | meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch b/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch new file mode 100644 index 0000000000..f7c55142f6 --- /dev/null +++ b/meta/recipes-extended/mdadm/files/mdadm-fix-ptest-build-errors.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From f3acf8499a4cc400206c5c56f0a6c69192ed55de Mon Sep 17 00:00:00 2001 | ||
2 | From: Wenzong Fan <wenzong.fan@windriver.com> | ||
3 | Date: Sat, 7 Nov 2015 04:21:17 -0500 | ||
4 | Subject: [PATCH] mdadm: fix ptest build errors | ||
5 | |||
6 | Check return value for posix_memalign() to fix ptest build error: | ||
7 | |||
8 | raid6check.c:352:2: error: ignoring return value of posix_memalign, \ | ||
9 | declared with attribute warn_unused_result [-Werror=unused-result] | ||
10 | |||
11 | Initialize *stripe_buf as NULL to fix ptest build error: | ||
12 | |||
13 | raid6check.c: In function 'check_stripes': | ||
14 | raid6check.c:315:8: error: 'stripe_buf' may be used uninitialized \ | ||
15 | in this function [-Werror=maybe-uninitialized] | ||
16 | |||
17 | Upstream-Status: Pending | ||
18 | |||
19 | Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> | ||
20 | --- | ||
21 | raid6check.c | 6 ++++-- | ||
22 | 1 file changed, 4 insertions(+), 2 deletions(-) | ||
23 | |||
24 | diff --git a/raid6check.c b/raid6check.c | ||
25 | index cb8522e..9462bcf 100644 | ||
26 | --- a/raid6check.c | ||
27 | +++ b/raid6check.c | ||
28 | @@ -312,7 +312,7 @@ int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets, | ||
29 | /* read the data and p and q blocks, and check we got them right */ | ||
30 | int data_disks = raid_disks - 2; | ||
31 | int syndrome_disks = data_disks + is_ddf(layout) * 2; | ||
32 | - char *stripe_buf; | ||
33 | + char *stripe_buf = NULL; | ||
34 | |||
35 | /* stripes[] is indexed by raid_disk and holds chunks from each device */ | ||
36 | char **stripes = xmalloc(raid_disks * sizeof(char*)); | ||
37 | @@ -349,7 +349,9 @@ int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets, | ||
38 | if (!tables_ready) | ||
39 | make_tables(); | ||
40 | |||
41 | - posix_memalign((void**)&stripe_buf, 4096, raid_disks * chunk_size); | ||
42 | + if (posix_memalign((void**)&stripe_buf, 4096, raid_disks * chunk_size) != 0) | ||
43 | + goto exitCheck; | ||
44 | + | ||
45 | block_index_for_slot += 2; | ||
46 | blocks += 2; | ||
47 | blocks_page += 2; | ||
48 | -- | ||
49 | 1.9.1 | ||
50 | |||