diff options
| author | 2019-08-01 13:57:36 +0000 | |
|---|---|---|
| committer | 2019-08-12 09:00:34 +0300 | |
| commit | 508c5849c62d009e03f37ad0f556071fac5112f0 (patch) | |
| tree | cf830b1f50c6ace76ea924efd2e4b02fd48870eb /include/linux/mfd/git:/ssh:/git@git.zx2c4.com | |
| parent | Linux 5.3-rc4 (diff) | |
| download | linux-dev-508c5849c62d009e03f37ad0f556071fac5112f0.tar.xz linux-dev-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 'include/linux/mfd/git:/ssh:/git@git.zx2c4.com')
0 files changed, 0 insertions, 0 deletions
