Re: [PATCH] btrfs: Check if tgt_device is not null

2017-07-12 Thread Nikolay Borisov
On 12.07.2017 18:03, David Sterba wrote: > On Wed, Jul 12, 2017 at 11:39:22AM +0300, Nikolay Borisov wrote: >> btrfs_err_in_rcu indiscriminately dereferences tgt_device to access its >> ->name member in an error path. However, couple of lines below there is code >> which checks whether tgt_device

Re: [PATCH] btrfs: Check if tgt_device is not null

2017-07-12 Thread David Sterba
On Wed, Jul 12, 2017 at 11:39:22AM +0300, Nikolay Borisov wrote: > btrfs_err_in_rcu indiscriminately dereferences tgt_device to access its > ->name member in an error path. However, couple of lines below there is code > which checks whether tgt_device is not NULL. Let's be consistent and check if >

[PATCH] btrfs: Check if tgt_device is not null

2017-07-12 Thread Nikolay Borisov
btrfs_err_in_rcu indiscriminately dereferences tgt_device to access its ->name member in an error path. However, couple of lines below there is code which checks whether tgt_device is not NULL. Let's be consistent and check if the tgt_device is NULL before dereferencing it. Signed-off-by: Nikolay