Fix a nasty off-by-one remoteproc bug which leaks memory when

a remote processor is shut down and, on certain circumstances,
 can indirectly prevent it from being reloaded.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJPs2y2AAoJELLolMlTRIoMcl0P/0fPAjNlIeMbiWy5FqTgwkM6
 QnujXPq0+fGRbO8ScjAVCVUmKewEbBtzA7h6b3XD4VUCMVIiWx2+hEhuYMNHduxj
 CnqwNsukl/PmPLBQucghuITjGqgAAasuO7UvE4b12vn/ZD8y28f21sL4S0G5DIAv
 GKLInkwMWwCjdNBa1CquVSl7t75TtEPByPuLa+3Cr+uhKP0zI+1TEyTzA6oSi+ub
 aR56yZCS2HF4jiTNKb/+x/mSeaCOhUb7/d8173c9fKFFU8jF6LNc0uRByLSUg2Ze
 2cU5UEhtxBhJ3fG2HuAMAvXJyFvriW+kYcUZeubgaHIWR/g+vNXYO4Q1Aoicve6V
 Ulp4y5Nwv4xbU3BLOm1r3CFioTTSBOpqHY6x1NjyJUCRGel0XWWsNuLvm6nMTVql
 GmzwKPH5nnyFI1piJRagLzPs1KbW6yBqwghiUkGagEfuHsjHPZ6RHMolVVSFhD5Z
 wmvwO8nJ59bgjMndz1VAPkcvihYDG8kZ2GrsOE7i8wLUK7V1MuI0SH5364nti58F
 dxetaqcOkARN4Alt+6mNgymOqybcueOUa9BhlosXyGRhHYfUnlQV1m+i5uT9P4pJ
 558rJ4PHJDqC3KsRLgY8oK9QIGOAthR+naUSSSipIfuiXnDNCydXEApY+Q5PkgEm
 +HBh+0lwlEWY2i+Ege3F
 =wUSA
 -----END PGP SIGNATURE-----

Merge tag 'rproc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc

Pull remoteproc fix from Ohad Ben-Cohen:
 "Fix a nasty off-by-one remoteproc bug which leaks memory when a remote
  processor is shut down and, on certain circumstances, can indirectly
  prevent it from being reloaded."

* tag 'rproc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc:
  remoteproc: fix off-by-one bug in __rproc_free_vrings
This commit is contained in:
Linus Torvalds 2012-05-16 14:26:05 -07:00
Родитель dfae359f08 6fd98c124c
Коммит f8fc341ba4
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -354,7 +354,7 @@ static void __rproc_free_vrings(struct rproc_vdev *rvdev, int i)
{
struct rproc *rproc = rvdev->rproc;
for (i--; i > 0; i--) {
for (i--; i >= 0; i--) {
struct rproc_vring *rvring = &rvdev->vring[i];
int size = PAGE_ALIGN(vring_size(rvring->len, rvring->align));