mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* re: mtip32xx: add a status field to struct mtip_cmd
@ 2017-04-21 14:06 Colin Ian King
  2017-04-21 14:14 ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Colin Ian King @ 2017-04-21 14:06 UTC (permalink / raw)
  To: Christoph Hellwig, Johannes Thumshirn, Jens Axboe; +Cc: linux-kernel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-04-21 19:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-21 14:06 mtip32xx: add a status field to struct mtip_cmd Colin Ian King
2017-04-21 14:14 ` Jens Axboe
2017-04-21 14:37   ` Christoph Hellwig
2017-04-21 14:47     ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome