Re: [HMM 12/15] mm/migrate: new memory migration helper for use with device memory v4

From: Jerome Glisse
Date: Mon Jul 10 2017 - 19:43:47 EST


On Mon, Jul 10, 2017 at 03:59:37PM -0700, Evgeny Baskakov wrote:
> On 6/30/17 5:57 PM, Jerome Glisse wrote:
> ...
>
> Hi Jerome,
>
> I am seeing a strange crash in our code that uses the hmm_device_new()
> helper. After the driver is repeatedly loaded/unloaded, hmm_device_new()
> suddenly returns NULL.
>
> I have reproduced this with the dummy driver from the hmm-next branch:
>
> BUG: unable to handle kernel NULL pointer dereference at 0000000000000208

Horrible stupid bug in the code, most likely from cut and paste. Attached
patch should fix it. I don't know how long it took for you to trigger it.

Jérôme