summaryrefslogtreecommitdiffstats
path: root/drivers/misc/habanalabs/context.c
diff options
context:
space:
mode:
authorTomer Tayar <ttayar@habana.ai>2019-08-01 15:57:36 +0200
committerOded Gabbay <oded.gabbay@gmail.com>2019-08-12 08:00:34 +0200
commit508c5849c62d009e03f37ad0f556071fac5112f0 (patch)
treecf830b1f50c6ace76ea924efd2e4b02fd48870eb /drivers/misc/habanalabs/context.c
parentLinux 5.3-rc4 (diff)
downloadlinux-508c5849c62d009e03f37ad0f556071fac5112f0.tar.xz
linux-508c5849c62d009e03f37ad0f556071fac5112f0.zip
habanalabs: Avoid double free in error flow
In case kernel context init fails during device initialization, both hl_ctx_put() and kfree() are called, ending with a double free of the kernel context. Calling kfree() is needed only when a failure happens between the allocation of the kernel context and its initialization, so move it to there and remove it from the error flow. Signed-off-by: Tomer Tayar <ttayar@habana.ai> Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to 'drivers/misc/habanalabs/context.c')
0 files changed, 0 insertions, 0 deletions