From: Peter Huewe Date: Tue, 19 Feb 2013 04:18:51 +0000 (+0100) Subject: staging/slicoss: Fix buffer possible overflow in slic_card_locate X-Git-Tag: omap-for-v3.10/dt-fixes-for-merge-window~137^2~773 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20d403e801272b84e033b8f17d3e45c4f66507c7;p=pandora-kernel.git staging/slicoss: Fix buffer possible overflow in slic_card_locate smatch complains about a possible buffer overflow slicoss.c:3651 slic_card_locate() error: buffer overflow 'physcard->adapter' 4 <= 4 If the for loop is not exited prematurely i++ is executed after the last iteration and thus i can be 4, which is out of bounds for physcard->adapter. -> Add check for this condition and simplify the if statement by inverting the condition. Signed-off-by: Peter Huewe Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed