]> git.baikalelectronics.ru Git - kernel.git/commit
vsprintf: make %pV handling compatible with kasprintf()
authorJan Beulich <JBeulich@suse.com>
Mon, 5 Mar 2012 16:49:24 +0000 (16:49 +0000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 6 Mar 2012 16:22:26 +0000 (08:22 -0800)
commit7710b36d8d77c6a3d33f0b7f3b10c23e677e8270
tree62873627752df2dd08b244e983b1cd89e31b72ee
parent36572656df4c99ee50e85904b28704a3e400d152
vsprintf: make %pV handling compatible with kasprintf()

kasprintf() (and potentially other functions that I didn't run across so
far) want to evaluate argument lists twice.  Caring to do so for the
primary list is obviously their job, but they can't reasonably be
expected to check the format string for instances of %pV, which however
need special handling too: On architectures like x86-64 (as opposed to
e.g.  ix86), using the same argument list twice doesn't produce the
expected results, as an internally managed cursor gets updated during
the first run.

Fix the problem by always acting on a copy of the original list when
handling %pV.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/vsprintf.c