]> git.sur5r.net Git - u-boot/commit
lib: circbuf: avoid possible null pointer dereference
authorxypron.glpk@gmx.de <xypron.glpk@gmx.de>
Wed, 3 May 2017 21:20:10 +0000 (23:20 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 5 May 2017 20:45:57 +0000 (16:45 -0400)
commit05d887b4619e54a2b7d487ac1c31b4544ce58533
treea7096fcd96ac176998753945e9fd73ac93ae9be3
parent1275a44e2f0579aba11d59c92c1717d5f9abc5e9
lib: circbuf: avoid possible null pointer dereference

We should not first dereference p and afterwards assert that is
was not NULL. Instead do the assert first.

The problem was indicated by cppcheck.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
lib/circbuf.c