All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/3] kernel/syscalls/fallocate: fix array parameter degradation
@ 2015-05-06 10:18 Wei,Jiangang
  2015-05-06 10:18 ` [LTP] [PATCH 2/3] kernel/syscalls/fallocate: specify size needs check Wei,Jiangang
  2015-05-06 10:18 ` [LTP] [PATCH 3/3] kernel/mem/mmapstress: fix resource leak Wei,Jiangang
  0 siblings, 2 replies; 18+ messages in thread
From: Wei,Jiangang @ 2015-05-06 10:18 UTC (permalink / raw)
  To: ltp-list

Using 'sizeof' on array given as function argument
returns size of a pointer, instead of the array's.
So,
It needs to pass an additional parameter size_t size
indicating the number of elements in the array.

This patch can fix it.

Signed-off-by: Wei,Jiangang <weijg.fnst@cn.fujitsu.com>
---
 testcases/kernel/syscalls/fallocate/fallocate04.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/testcases/kernel/syscalls/fallocate/fallocate04.c b/testcases/kernel/syscalls/fallocate/fallocate04.c
index 723c886..a6d1159 100644
--- a/testcases/kernel/syscalls/fallocate/fallocate04.c
+++ b/testcases/kernel/syscalls/fallocate/fallocate04.c
@@ -98,9 +98,8 @@ static void setup(void)
 	get_blocksize();
 }
 
-static void check_file_data(const char exp_buf[])
+static void check_file_data(const char exp_buf[], size_t size)
 {
-	size_t size = sizeof(exp_buf);
 	char rbuf[size];
 
 	tst_resm(TINFO, "reading the file, compare with expected buffer");
-- 
1.9.3


------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2015-05-19  9:23 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-06 10:18 [LTP] [PATCH 1/3] kernel/syscalls/fallocate: fix array parameter degradation Wei,Jiangang
2015-05-06 10:18 ` [LTP] [PATCH 2/3] kernel/syscalls/fallocate: specify size needs check Wei,Jiangang
2015-05-06 20:42   ` Alexey Kodanev
2015-05-07  4:53     ` Wei, Jiangang
2015-05-07  6:17     ` [LTP] [PATCH v2] kernel/syscalls/fallocate: fix array parameter degradation Wei,Jiangang
2015-05-07  9:37       ` Alexey Kodanev
2015-05-07  9:54         ` Wei, Jiangang
2015-05-12  5:43           ` Wanlong Gao
2015-05-12  5:44             ` Wanlong Gao
2015-05-12  5:52               ` Wei, Jiangang
2015-05-06 10:18 ` [LTP] [PATCH 3/3] kernel/mem/mmapstress: fix resource leak Wei,Jiangang
2015-05-07 14:05   ` Alexey Kodanev
2015-05-08  6:42     ` Wei, Jiangang
2015-05-12  9:12       ` Cyril Hrubis
2015-05-13 12:03       ` Alexey Kodanev
2015-05-08  6:47     ` [LTP] [PATCH v2] " Wei,Jiangang
2015-05-19  3:34   ` [LTP] [PATCH] mmapstress01: Modify readbuf's type and define it to uchar_t Zeng Linggang
2015-05-19  9:23     ` Jan Stancek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.