diff options
author | Alan Cox <alan@linux.intel.com> | 2012-07-25 14:51:04 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-07-26 09:50:04 +0200 |
commit | 0274df3e43be962eee0499ee97c514fdb1c8f3ae (patch) | |
tree | 4f4591b7006ca6709cdc7272a2fd4e1b247ca70e | |
parent | vlv: it might be wise if we initialised the flag value... (diff) | |
download | linux-0274df3e43be962eee0499ee97c514fdb1c8f3ae.tar.xz linux-0274df3e43be962eee0499ee97c514fdb1c8f3ae.zip |
i915: fix error path leak in intel_sdvo_write_cmd
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/i915/intel_sdvo.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index 26a6a4d0d078..d172e9873131 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c @@ -444,13 +444,16 @@ static bool intel_sdvo_write_cmd(struct intel_sdvo *intel_sdvo, u8 cmd, struct i2c_msg *msgs; int i, ret = true; + /* Would be simpler to allocate both in one go ? */ buf = (u8 *)kzalloc(args_len * 2 + 2, GFP_KERNEL); if (!buf) return false; msgs = kcalloc(args_len + 3, sizeof(*msgs), GFP_KERNEL); - if (!msgs) + if (!msgs) { + kfree(buf); return false; + } intel_sdvo_debug_write(intel_sdvo, cmd, args, args_len); |