]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
[media] staging: atomisp: Fix endless recursion in hmm_init
authorHans de Goede <hdegoede@redhat.com>
Fri, 2 Jun 2017 20:04:23 +0000 (17:04 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 7 Jun 2017 15:51:49 +0000 (12:51 -0300)
commitaf822177d614f985cb89dcf6e505e2d76a3f3683
tree4ff78ad68f4ea6bc8ed01153c7d91424f45cdf3f
parentf1e627a41db14a4bb7bb5ee39486528121ed11c2
[media] staging: atomisp: Fix endless recursion in hmm_init

hmm_init calls hmm_alloc to set dummy_ptr, hmm_alloc calls
hmm_init when dummy_ptr is not yet set, which is the case in
the call from hmm_init, so it calls hmm_init again, this continues
until we have a stack overflow due to the recursion.

This commit fixes this by adding a separate flag for tracking if
hmm_init has been called. Not pretty, but it gets the job done,
eventually we should be able to remove the hmm_init call from
hmm_alloc.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm.c