From: alex chen Date: Fri, 16 Jan 2015 23:52:03 +0000 (-0800) Subject: pstore: Fix sprintf format specifier in pstore_dump() X-Git-Tag: firefly_0821_release~176^2~2356^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a6b8978c54b771308f6f1692b9735ac0bb087cc2;p=firefly-linux-kernel-4.4.55.git pstore: Fix sprintf format specifier in pstore_dump() We should use sprintf format specifier "%u" instead of "%d" for argument of type 'unsigned int' in pstore_dump(). Signed-off-by: Alex Chen Reviewed-by: Joseph Qi Acked-by: Kees Cook Signed-off-by: Tony Luck --- diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 15ee78c5020b..c4c9a10c5760 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -301,7 +301,7 @@ static void pstore_dump(struct kmsg_dumper *dumper, if (big_oops_buf) { dst = big_oops_buf; - hsize = sprintf(dst, "%s#%d Part%d\n", why, + hsize = sprintf(dst, "%s#%d Part%u\n", why, oopscount, part); size = big_oops_buf_sz - hsize; @@ -321,7 +321,7 @@ static void pstore_dump(struct kmsg_dumper *dumper, } } else { dst = psinfo->buf; - hsize = sprintf(dst, "%s#%d Part%d\n", why, oopscount, + hsize = sprintf(dst, "%s#%d Part%u\n", why, oopscount, part); size = psinfo->bufsize - hsize; dst += hsize;