block, sx8: fix pointer math issue getting fw version
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 3 Mar 2012 11:09:17 +0000 (12:09 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 7 Oct 2012 21:37:33 +0000 (23:37 +0200)
commit ea5f4db8ece896c2ab9eafa0924148a2596c52e4 upstream.

"mem" is type u8.  We need parenthesis here or it screws up the pointer
math probably leading to an oops.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/block/sx8.c

index a7c4184f4a63355539976a010e0c50700d4c5318..bcbfc20bcb1adb2f5a84aec21e9054ab0d292c2d 100644 (file)
@@ -1116,7 +1116,7 @@ static inline void carm_handle_resp(struct carm_host *host,
                        break;
                case MISC_GET_FW_VER: {
                        struct carm_fw_ver *ver = (struct carm_fw_ver *)
-                               mem + sizeof(struct carm_msg_get_fw_ver);
+                               (mem + sizeof(struct carm_msg_get_fw_ver));
                        if (!error) {
                                host->fw_ver = le32_to_cpu(ver->version);
                                host->flags |= (ver->features & FL_FW_VER_MASK);