Skip to content
Commit a1104016 authored by Julia Lawall's avatar Julia Lawall Committed by Jeff Garzik
Browse files

drivers/ata/libata: Move dereference after NULL test



In each case, if the NULL test on qc is needed, then the derefernce
should be after the NULL test.

A simplified version of the semantic match that detects this problem is as
follows (http://coccinelle.lip6.fr/):

// <smpl>
@match exists@
expression x, E;
identifier fld;
@@

* x->fld
  ... when != \(x = E\|&x\)
* x == NULL
// </smpl>

Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent e65cc194
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment