Commit 0274df3e authored by Alan Cox's avatar Alan Cox Committed by Daniel Vetter

i915: fix error path leak in intel_sdvo_write_cmd

Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent af447bd3
...@@ -444,13 +444,16 @@ static bool intel_sdvo_write_cmd(struct intel_sdvo *intel_sdvo, u8 cmd, ...@@ -444,13 +444,16 @@ static bool intel_sdvo_write_cmd(struct intel_sdvo *intel_sdvo, u8 cmd,
struct i2c_msg *msgs; struct i2c_msg *msgs;
int i, ret = true; int i, ret = true;
/* Would be simpler to allocate both in one go ? */
buf = (u8 *)kzalloc(args_len * 2 + 2, GFP_KERNEL); buf = (u8 *)kzalloc(args_len * 2 + 2, GFP_KERNEL);
if (!buf) if (!buf)
return false; return false;
msgs = kcalloc(args_len + 3, sizeof(*msgs), GFP_KERNEL); msgs = kcalloc(args_len + 3, sizeof(*msgs), GFP_KERNEL);
if (!msgs) if (!msgs) {
kfree(buf);
return false; return false;
}
intel_sdvo_debug_write(intel_sdvo, cmd, args, args_len); intel_sdvo_debug_write(intel_sdvo, cmd, args, args_len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment