]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] fix: dmi_check_system
authorRobert Love <rml@novell.com>
Tue, 6 Sep 2005 22:18:30 +0000 (15:18 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 7 Sep 2005 23:57:44 +0000 (16:57 -0700)
commit8a9c68341488a66e0ce242f58b92cf3ee655cd7c
tree7e3976e7e2a76b857d3087821366dad89691ceeb
parentb1479263c6300c398611300effc2a321eba54513
[PATCH] fix: dmi_check_system

Background:

1) dmi_check_system() returns the count of the number of
   matches.  Zero thus means no matches.
2) A match callback can return nonzero to stop the match
   checking.

Bug: The count is incremented after we check for the nonzero return value,
so it does not reflect the actual count.  We could say this is intended,
for some dumb reason, except that it means that a match on the first check
returns zero--no matches--if the callback returns nonzero.

Attached patch implements the count before calling the callback and thus
before potentially short-circuiting.

Signed-off-by: Robert Love <rml@novell.com>
Cc: Andrey Panin <pazke@donpac.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/i386/kernel/dmi_scan.c