Re: [PATCH 4/7] chtls: kbuild warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 25, 2018 at 08:35:32PM +0530, Atul Gupta wrote:
> - unindented continue
> - check for null page
> - signed return
> 
> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Signed-off-by: Atul Gupta <atul.gupta@xxxxxxxxxxx>
> ---
>  drivers/crypto/chelsio/chtls/chtls_io.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/crypto/chelsio/chtls/chtls_io.c b/drivers/crypto/chelsio/chtls/chtls_io.c
> index 85ddc07..ce90ba1 100644
> --- a/drivers/crypto/chelsio/chtls/chtls_io.c
> +++ b/drivers/crypto/chelsio/chtls/chtls_io.c
> @@ -907,11 +907,11 @@ static int chtls_skb_copy_to_page_nocache(struct sock *sk,
>  }
>  
>  /* Read TLS header to find content type and data length */
> -static u16 tls_header_read(struct tls_hdr *thdr, struct iov_iter *from)
> +static int tls_header_read(struct tls_hdr *thdr, struct iov_iter *from)
>  {
>  	if (copy_from_iter(thdr, sizeof(*thdr), from) != sizeof(*thdr))
>  		return -EFAULT;
> -	return (__force u16)cpu_to_be16(thdr->length);
> +	return (__force int)cpu_to_be16(thdr->length);
>  }
>  
>  static int csk_mem_free(struct chtls_dev *cdev, struct sock *sk)
> @@ -1083,6 +1083,9 @@ int chtls_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
>  			int off = TCP_OFF(sk);
>  			bool merge;
>  
> +			if (!page)
                             ^^^^
> +				goto wait_for_memory;
> +
>  			if (page)
                            ^^^^
This second condition isn't necessary.

regards,
dan carpenter




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux