Skip to contentSkip to conversation

pktcdvd: add struct pktcdvd_device * to pkt_dbg

PATCH In review Dan Carpenter 4 participants 6 messages Aug 1, 2013 – Aug 26, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello Joe Perches,

This is a semi-automatic email about new static checker warnings.

The patch 3567318a63ff: "pktcdvd: add struct pktcdvd_device * to pkt_dbg" from Aug 1, 2013, leads to the following Smatch complaint:

drivers/block/pktcdvd.c:2844 pkt_remove_dev()
error: we previously assumed 'pd' could be null (see line 2840)

drivers/block/pktcdvd.c
2839 pd = pkt_devs[idx];
2840 if (pd && (pd->pkt_dev = pkt_dev))

                            ^^

Old check.

2841 break;
2842 }
2843 if (idx = MAX_WRITERS) {

  2844			pkt_dbg(1, pd, "dev not setup\n");
                                   ^^

New dereference.

  2845			ret = -ENXIO;
  2846			goto out;

regards,
dan carpenter

#1 lore raw
Quoted 2 lines · Dan Carpenter

drivers/block/pktcdvd.c:2844 pkt_remove_dev()
error: we previously assumed 'pd' could be null (see line 2840)

Thanks Dan, I'll fix.

#2 lore raw

PATCH 1/1 pktcdvd: Fix defective misuses of pkt_<level>

In reply to Dan Carpenter

Fix thinkos where pkt_<level> needs a valid
pktcdvd_device * and the pointer is known to
be NULL.

---

Andrew, I believe Jiri picked up this series and
you can drop them from mm. Thanks.

 drivers/block/pktcdvd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/block/pktcdvd.c +3 -3
index 29a5194..5618847 100644
@@ -2360,8 +2360,8 @@ static void pkt_make_request(struct request_queue *q, struct bio *bio)
 
 	pd = q->queuedata;
 	if (!pd) {
-		pkt_err(pd, "%s incorrect request queue\n",
-			bdevname(bio->bi_bdev, b));
+		pr_err("%s incorrect request queue\n",
+		       bdevname(bio->bi_bdev, b));
 		goto end_io;
 	}
 
@@ -2841,7 +2841,7 @@ static int pkt_remove_dev(dev_t pkt_dev)
 			break;
 	}
 	if (idx = MAX_WRITERS) {
-		pkt_dbg(1, pd, "dev not setup\n");
+		pr_debug("dev not setup\n");
 		ret = -ENXIO;
 		goto out;
 	}
#3 lore raw

Re: [PATCH] pktcdvd: Fix defective misuses of pkt_<level>

Quoted 2 lines · On Fri, 02 Aug 2013 13:10:54 -0700 Joe Perches <[email protected]> wrote:

Andrew, I believe Jiri picked up this series and
you can drop them from mm. Thanks.

Shall do if/when they turn up in linux-next.

#4 lore raw

Re: [PATCH] pktcdvd: Fix defective misuses of pkt_<level>

Quoted 4 lines · Andrew Morton
Quoted 2 lines

Andrew, I believe Jiri picked up this series and
you can drop them from mm. Thanks.

Shall do if/when they turn up in linux-next.

Pull request to Jens is there [1], but his branch has been silent for two weeks ...

[1] https://lkml.org/lkml/2013/7/30/277

Signature · 2 lines
Jiri Kosina
SUSE Labs
#5 lore raw

Re: [PATCH] pktcdvd: Fix defective misuses of pkt_<level>

Quoted 9 lines · Jiri Kosina
Quoted 4 lines
Quoted 2 lines

Andrew, I believe Jiri picked up this series and
you can drop them from mm. Thanks.

Shall do if/when they turn up in linux-next.

Pull request to Jens is there [1], but his branch has been silent for two weeks ...

[1] https://lkml.org/lkml/2013/7/30/277

And here goes a friendly ping to Jens ... ? :)

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs