On 2016/12/15 16:28, Qu Wenruo wrote:
> The subvol_info returned from subvol_uuid_search() can be NULL.
> So the branch checking IS_ERR(si) should also check if it's NULL.
> 
> Reported-by: Tsutomu Itoh <[email protected]>
> Signed-off-by: Qu Wenruo <[email protected]>
> ---
>  cmds-receive.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/cmds-receive.c b/cmds-receive.c
> index cb42aa2..c8f2fff 100644
> --- a/cmds-receive.c
> +++ b/cmds-receive.c
> @@ -750,7 +750,7 @@ static int process_clone(const char *path, u64 offset, 
> u64 len,
>       si = subvol_uuid_search(&rctx->sus, 0, clone_uuid, clone_ctransid,
>                               NULL,
>                               subvol_search_by_received_uuid);
> -     if (IS_ERR(si)) {
> +     if (IS_ERR(si) || !si) {

Tested-by: Tsutomu Itoh <[email protected]>

But I like  if (!si || IS_ERR(si)) {

Thanks,
Tsutomu

>               if (memcmp(clone_uuid, rctx->cur_subvol.received_uuid,
>                               BTRFS_UUID_SIZE) == 0) {
>                       /* TODO check generation of extent */
> 

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

Reply via email to