Re: [PATCH] gpib: fluke: Fix an error handling path in fluke_dma_read()

From: Dan Carpenter
Date: Tue Dec 09 2025 - 08:53:50 EST


On Sat, Dec 06, 2025 at 08:02:25AM +0100, Christophe JAILLET wrote:
> It is strange to call dma_unmap_single() with its 'dev' argument
> explicitly set to NULL.
> It is likely to crash.

I've added the assumption to Smatch that it will crash. Which as you
say is not true, but I think it probably is the correct assumption,
right?

This is a one liner in Smatch.

regards,
dan carpenter

diff --git a/smatch_dereference.c b/smatch_dereference.c
index 15ad885af085..acd70ef9dec4 100644
--- a/smatch_dereference.c
+++ b/smatch_dereference.c
@@ -34,6 +34,7 @@ static struct deref_info fn_deref_table[] = {
{ "__fortify_strlen", 0, "$" },
{ "spinlock_check", 0, "$" },
{ "devm_platform_ioremap_resource_byname", 1, "$" },
+ { "dma_unmap_single_attrs", 0, "$" },
};

void add_dereference_hook(expr_func *fn)