This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 656836 - Memory leak in virtio-console driver if driver probe routine fails
Memory leak in virtio-console driver if driver probe routine fails
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel (Show other bugs)
Unspecified Unspecified
low Severity medium
: rc
: ---
Assigned To: Amit Shah
Virtualization Bugs
: Triaged
Depends On: 656835
Blocks: Rhel5KvmTier3
  Show dependency treegraph
Reported: 2010-11-24 04:35 EST by Amit Shah
Modified: 2013-01-09 18:22 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 656835
Last Closed: 2011-07-21 06:23:51 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Amit Shah 2010-11-24 04:35:46 EST
(cloned to 5.7 from the 6.1 bug)

+++ This bug was initially created as a clone of Bug #656835 +++

Description of problem:
Jiri Slaby used stanse to find a memory leak in a failure case:

Stanse found that in init_vqs, memory is leaked under certain
circumstanses (the fail path order is incorrect). Fix that by checking
allocations in one turn and free all of them at once if some fails
(some may be NULL, but this is OK).
Comment 1 Amit Shah 2010-11-24 04:37:25 EST
Testing notes:  not easily testable.  Was found by a static code checker and confirmed by code reading.  Unlikely to happen in practice as it can happen only in very low memory conditions.
Comment 5 RHEL Product and Program Management 2011-02-01 11:54:16 EST
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
Comment 7 Jarod Wilson 2011-02-21 15:57:14 EST
in kernel-2.6.18-245.el5
You can download this test kernel (or newer) from

Detailed testing feedback is always welcomed.
Comment 10 juzhang 2011-06-07 22:01:16 EDT
Verified on 2.6.18-265.el5 kernel-2.6.18-265.el5 sources code and check,The patch is applied.

--snip of source code--
+       if (!vqs || !io_callbacks || !io_names || !portdev->in_vqs ||
+                       !portdev->out_vqs) {
                err = -ENOMEM;
-               goto free_invqs;
+               goto free;

2.#rpm -ql kernel --changelog | grep 656836
- [char] virtio_console: fix memory leak (Amit Shah) [656836]
- [char] virtio_console: fix memory leak (Amit Shah) [656836]
- [char] virtio_console: fix memory leak (Amit Shah) [656836]

This issue has been fixed.
Comment 11 errata-xmlrpc 2011-07-21 06:23:51 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

Note You need to log in before you can comment on or make changes to this bug.