archive mirror
 help / color / mirror / Atom feed
From: Thomas Tai <>
To: Christoph Hellwig <>
Subject: Re: [PATCH] dma-direct: Fix potential NULL pointer dereference
Date: Tue, 15 Sep 2020 10:11:51 -0400	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On 2020-09-15 10:07 a.m., Christoph Hellwig wrote:
> On Tue, Sep 15, 2020 at 08:03:14AM -0600, Thomas Tai wrote:
>> When booting the kernel v5.9-rc4 on a VM, the kernel would panic when
>> printing a warning message in swiotlb_map(). It is because dev->dma_mask
>> can potentially be a null pointer. Using the dma_get_mask() macro can
>> avoid the NULL pointer dereference.
> dma_mask must not be zero.  This means drm is calling DMA API functions
> on something weird.  This needs to be fixed in the caller.

Thanks, Christoph for your comment. The caller already fixed the null 
pointer in the latest v5.9-rc5. I am thinking that if we had used the 
dma_get_mask(), the kernel couldn't panic and could properly print out 
the warning message.

iommu mailing list

  parent reply	other threads:[~2020-09-15 14:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15 14:03 [PATCH] dma-direct: Fix potential NULL pointer dereference Thomas Tai
2020-09-15 14:07 ` Christoph Hellwig
2020-09-15 14:08   ` Christoph Hellwig
2020-09-15 14:11   ` Thomas Tai [this message]
2020-09-15 14:26     ` Christoph Hellwig
2020-09-15 14:40       ` Thomas Tai
2020-09-15 15:09         ` Christoph Hellwig
2020-09-15 15:12           ` Thomas Tai
2020-09-15 20:46           ` Thomas Tai
2020-09-16  6:19             ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).