dtc: pos parameter to srcpos_string() can't be NULL

None of the callers ever pass a NULL to srcpos_string(), so the check
for it is not necessary.  Furthermore, checking it make Coverity complain
about the raw dereferences which follow later in the function.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
David Gibson 2017-02-08 17:39:36 +11:00
parent 95d57726bc
commit 00d7bb1f4b

View file

@ -252,7 +252,7 @@ srcpos_string(struct srcpos *pos)
const char *fname = "<no-file>";
char *pos_str;
if (pos)
if (pos->file && pos->file->name)
fname = pos->file->name;