Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1040361AbdDUOHI (ORCPT ); Fri, 21 Apr 2017 10:07:08 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:54275 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1040296AbdDUOHF (ORCPT ); Fri, 21 Apr 2017 10:07:05 -0400 To: Christoph Hellwig , Johannes Thumshirn , Jens Axboe Cc: "linux-kernel@vger.kernel.org" From: Colin Ian King Subject: re: mtip32xx: add a status field to struct mtip_cmd Message-ID: <933d95b1-ee6c-eb74-9197-32852e7f7728@canonical.com> Date: Fri, 21 Apr 2017 15:06:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 830 Lines: 29 Hi, CoverityScan found an issue with the following part of the patch: - if (likely(!reserv)) - blk_mq_complete_request(rq, -ENODEV); - else if (test_bit(MTIP_PF_IC_ACTIVE_BIT, &dd->port->flags)) { + if (likely(!reserv)) { + cmd->status = -ENODEV; + blk_mq_complete_request(rq, 0); + } else if (test_bit(MTIP_PF_IC_ACTIVE_BIT, &dd->port->flags)) { The issue is: static void mtip_no_dev_cleanup(struct request *rq, void *data, bool reserv) { struct driver_data *dd = (struct driver_data *)data; struct mtip_cmd *cmd; if (likely(!reserv)) { cmd->status = -ENODEV; CID 1430258 (#1 of 1): Uninitialized pointer write (UNINIT)4. uninit_use: Using uninitialized value cmd. ..basically a null ptr dereference on cmd. Colin