All of lore.kernel.org
 help / color / mirror / Atom feed
* sign a bug in “set_extent_bit”
@ 2011-07-12 15:40 Qiang Zhu
  2011-07-13  1:30 ` Li Zefan
  0 siblings, 1 reply; 2+ messages in thread
From: Qiang Zhu @ 2011-07-12 15:40 UTC (permalink / raw)
  To: linux-btrfs

hi=C2=A0

In the end part of =E2=80=9Cset_extent_bit=E2=80=9D=EF=BC=8CI found whe=
n err occurs =EF=BC=8Cthere is no operate to free "prealloc" which have=
 been allocated in "alloc_extent_state_atomic"
this may lead a menory leak when "set_state_bits" failed.
err =3D set_state_bits(tree, prealloc, &bits);

if (err) {
prealloc =3D NULL;
goto out; // this direct will do nothing because prealloc=3DNULL.
}
wish your reply.
thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: sign a bug in “set_extent_bit”
  2011-07-12 15:40 sign a bug in “set_extent_bit” Qiang Zhu
@ 2011-07-13  1:30 ` Li Zefan
  0 siblings, 0 replies; 2+ messages in thread
From: Li Zefan @ 2011-07-13  1:30 UTC (permalink / raw)
  To: Qiang Zhu; +Cc: linux-btrfs

Qiang Zhu wrote:
> hi=20
>=20
> In the end part of =E2=80=9Cset_extent_bit=E2=80=9D=EF=BC=8CI found w=
hen err occurs =EF=BC=8Cthere is no operate to free "prealloc" which ha=
ve been allocated in "alloc_extent_state_atomic"
> this may lead a menory leak when "set_state_bits" failed.

No, it won't. 'prealloc' has been inserted into rbtree before set_state=
_bits()
is called().

> err =3D set_state_bits(tree, prealloc, &bits);
>=20
> if (err) {
> prealloc =3D NULL;
> goto out; // this direct will do nothing because prealloc=3DNULL.
> }
> wish your reply.

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-13  1:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-12 15:40 sign a bug in “set_extent_bit” Qiang Zhu
2011-07-13  1:30 ` Li Zefan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.