This patch plugs two memory leaks in the sg driver. The first was reported by Vegard Nossum and the second was found by checking for the same pattern. ChangeLog: - close two heap memory leaks. The first is an error path; the second is associated with getting debug information from procfs and sysfs. The patch is generated from lk 3.12.0-rc2 . Signed-off-by: Douglas Gilbert