Re: [Qemu-devel] [PATCH] memory: check write/read_with_attrs in memory dispatch

2018-11-20 Thread Li Qiang
Ping... It makes sense as when we use 'memory_region_read_accessor' we check mr->ops->read. but when we use 'memory_region_read_with_attrs_accessor', we doesn't check this. Thanks, Li Qiang Li Qiang 于2018年11月13日周二 上午9:42写道: > This can avoid the NULL-deref if the rm doesn't has a > read/write n

Re: [Qemu-devel] [PATCH] memory: check write/read_with_attrs in memory dispatch

2018-11-13 Thread Li Qiang
Peter Maydell 于2018年11月13日周二 下午5:49写道: > On 13 November 2018 at 01:42, Li Qiang wrote: > > This can avoid the NULL-deref if the rm doesn't has a > > read/write nor write/read_with_attrs callback. > > > > Signed-off-by: Li Qiang > > --- > > memory.c | 8 ++-- > > 1 file changed, 6 insertion

Re: [Qemu-devel] [PATCH] memory: check write/read_with_attrs in memory dispatch

2018-11-13 Thread Peter Maydell
On 13 November 2018 at 01:42, Li Qiang wrote: > This can avoid the NULL-deref if the rm doesn't has a > read/write nor write/read_with_attrs callback. > > Signed-off-by: Li Qiang > --- > memory.c | 8 ++-- > 1 file changed, 6 insertions(+), 2 deletions(-) Alternative approach -- assert that

[Qemu-devel] [PATCH] memory: check write/read_with_attrs in memory dispatch

2018-11-12 Thread Li Qiang
This can avoid the NULL-deref if the rm doesn't has a read/write nor write/read_with_attrs callback. Signed-off-by: Li Qiang --- memory.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/memory.c b/memory.c index d14c6dec1d..3baf5857b9 100644 --- a/memory.c +++ b/memor