[sheepdog] [PATCH] sheep: fix possible NULL defererence by stat_request_begin

Robin Dong robin.k.dong at gmail.com
Fri Jan 10 03:46:36 CET 2014


Reviewed-by: Robin Dong <sanbai at taobao.com>


2014/1/9 Liu Yuan <namei.unix at gmail.com>

> After queue_peer_request(), request might be released, so move
> stat_request_begin
> ahead of request handling to avoid possible NULL deferencec.
>
> Reported-by: Marcin Mirosław <marcin at mejor.pl>
> Signed-off-by: Liu Yuan <namei.unix at gmail.com>
> ---
>  sheep/request.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/sheep/request.c b/sheep/request.c
> index 9f3f110..161b7db 100644
> --- a/sheep/request.c
> +++ b/sheep/request.c
> @@ -474,7 +474,7 @@ static void queue_request(struct request *req)
>         }
>
>         req->vinfo = get_vnode_info();
> -
> +       stat_request_begin(req);
>         if (is_peer_op(req->op)) {
>                 queue_peer_request(req);
>         } else if (is_gateway_op(req->op)) {
> @@ -491,7 +491,6 @@ static void queue_request(struct request *req)
>                 rsp->result = SD_RES_SYSTEM_ERROR;
>                 goto done;
>         }
> -       stat_request_begin(req);
>
>         return;
>  done:
> --
> 1.8.1.2
>
> --
> sheepdog mailing list
> sheepdog at lists.wpkg.org
> http://lists.wpkg.org/mailman/listinfo/sheepdog
>



-- 
--
Best Regard
Robin Dong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/sheepdog/attachments/20140110/39ce937b/attachment-0004.html>


More information about the sheepdog mailing list