• Robert Love's avatar
    [PATCH] fix: dmi_check_system · 640e8033
    Robert Love authored
    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: default avatarRobert Love <rml@novell.com>
    Cc: Andrey Panin <pazke@donpac.ru>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    640e8033
dmi_scan.c 6.95 KB