From: Olev Kartau Date: Fri, 16 Mar 2012 07:05:20 +0000 (+0200) Subject: gfx: pvr: fw_version should compare 4 integers instead of 4 bytes X-Git-Tag: 2.1b_release~187 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d8c64a2ad97d050f7011aab1ef153316ccd6a3b8;p=kernel%2Fkernel-mfld-blackbay.git gfx: pvr: fw_version should compare 4 integers instead of 4 bytes sizeof() was misused in fw_version_supported; If array is given as argument, the size of it is size of pointer, so comparison used only first 4 bytes instead of 4 integers, which made all entries to match. Signed-off-by: Olev Kartau Reviewed-by: Jani Nikula Signed-off-by: Kirill A. Shutemov --- diff --git a/drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/sgxinit.c b/drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/sgxinit.c index dccb448..2d8e7a9 100644 --- a/drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/sgxinit.c +++ b/drivers/staging/mrst/pvr/services4/srvkm/devices/sgx/sgxinit.c @@ -1987,7 +1987,7 @@ static int fw_version_supported(const int fw_ver[4]) int i; for (i = 0; i < ARRAY_SIZE(sup_versions); i++) - if (!memcmp(fw_ver, sup_versions[i], sizeof(fw_ver))) + if (!memcmp(fw_ver, sup_versions[i], 4 * sizeof(int))) return 1; return 0;