[kbuild] [net-next:master 207/219] net/tls/tls_sw.c:885 tls_sw_sendmsg() error: uninitialized symbol 'ret'.

2018-09-23 Thread Dan Carpenter
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 
master
head:   bd4d08daeb959234a9f8365037b0fefa6ae790c6
commit: a42055e8d2c30d4decfc13ce943d09c7b9dad221 [207/219] net/tls: Add support 
for async encryption of records for performance

smatch warnings:
net/tls/tls_sw.c:885 tls_sw_sendmsg() error: uninitialized symbol 'ret'.
net/tls/tls_sw.c:1014 tls_sw_sendpage() error: uninitialized symbol 'ret'.

# 
https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/commit/?id=a42055e8d2c30d4decfc13ce943d09c7b9dad221
git remote add net-next 
https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
git remote update net-next
git checkout a42055e8d2c30d4decfc13ce943d09c7b9dad221
vim +/ret +885 net/tls/tls_sw.c

a42055e8 Vakul Garg  2018-09-21   693  
a42055e8 Vakul Garg  2018-09-21   694  int tls_sw_sendmsg(struct sock 
*sk, struct msghdr *msg, size_t size)
a42055e8 Vakul Garg  2018-09-21   695  {
3c4d7559 Dave Watson 2017-06-14   696   long timeo = sock_sndtimeo(sk, 
msg->msg_flags & MSG_DONTWAIT);
a42055e8 Vakul Garg  2018-09-21   697   struct tls_context *tls_ctx = 
tls_get_ctx(sk);
a42055e8 Vakul Garg  2018-09-21   698   struct tls_sw_context_tx *ctx = 
tls_sw_ctx_tx(tls_ctx);
a42055e8 Vakul Garg  2018-09-21   699   struct crypto_tfm *tfm = 
crypto_aead_tfm(ctx->aead_send);
a42055e8 Vakul Garg  2018-09-21   700   bool async_capable = 
tfm->__crt_alg->cra_flags & CRYPTO_ALG_ASYNC;
a42055e8 Vakul Garg  2018-09-21   701   unsigned char record_type = 
TLS_RECORD_TYPE_DATA;
a42055e8 Vakul Garg  2018-09-21   702   bool is_kvec = 
msg->msg_iter.type & ITER_KVEC;
3c4d7559 Dave Watson 2017-06-14   703   bool eor = !(msg->msg_flags & 
MSG_MORE);
3c4d7559 Dave Watson 2017-06-14   704   size_t try_to_copy, copied = 0;
a42055e8 Vakul Garg  2018-09-21   705   struct tls_rec *rec;
a42055e8 Vakul Garg  2018-09-21   706   int required_size;
a42055e8 Vakul Garg  2018-09-21   707   int num_async = 0;
3c4d7559 Dave Watson 2017-06-14   708   bool full_record;
a42055e8 Vakul Garg  2018-09-21   709   int record_room;
a42055e8 Vakul Garg  2018-09-21   710   int num_zc = 0;
3c4d7559 Dave Watson 2017-06-14   711   int orig_size;
a42055e8 Vakul Garg  2018-09-21   712   int ret;
3c4d7559 Dave Watson 2017-06-14   713  
3c4d7559 Dave Watson 2017-06-14   714   if (msg->msg_flags & ~(MSG_MORE 
| MSG_DONTWAIT | MSG_NOSIGNAL))
3c4d7559 Dave Watson 2017-06-14   715   return -ENOTSUPP;
3c4d7559 Dave Watson 2017-06-14   716  
3c4d7559 Dave Watson 2017-06-14   717   lock_sock(sk);
3c4d7559 Dave Watson 2017-06-14   718  
a42055e8 Vakul Garg  2018-09-21   719   /* Wait till there is any 
pending write on socket */
a42055e8 Vakul Garg  2018-09-21   720   if 
(unlikely(sk->sk_write_pending)) {
a42055e8 Vakul Garg  2018-09-21   721   ret = 
wait_on_pending_writer(sk, );
a42055e8 Vakul Garg  2018-09-21   722   if (unlikely(ret))
3c4d7559 Dave Watson 2017-06-14   723   goto send_end;
a42055e8 Vakul Garg  2018-09-21   724   }
3c4d7559 Dave Watson 2017-06-14   725  
3c4d7559 Dave Watson 2017-06-14   726   if 
(unlikely(msg->msg_controllen)) {
3c4d7559 Dave Watson 2017-06-14   727   ret = 
tls_proccess_cmsg(sk, msg, _type);
a42055e8 Vakul Garg  2018-09-21   728   if (ret) {
a42055e8 Vakul Garg  2018-09-21   729   if (ret == 
-EINPROGRESS)
a42055e8 Vakul Garg  2018-09-21   730   
num_async++;
a42055e8 Vakul Garg  2018-09-21   731   else if (ret != 
-EAGAIN)
3c4d7559 Dave Watson 2017-06-14   732   goto 
send_end;
3c4d7559 Dave Watson 2017-06-14   733   }
a42055e8 Vakul Garg  2018-09-21   734   }
3c4d7559 Dave Watson 2017-06-14   735  
3c4d7559 Dave Watson 2017-06-14   736   while (msg_data_left(msg)) {

I guess Smatch is complaining that it can't be sure that we always enter
this loop.  50/50 it's a false positive.

3c4d7559 Dave Watson 2017-06-14   737   if (sk->sk_err) {
30be8f8d r.her...@avm.de 2018-01-12   738   ret = 
-sk->sk_err;
3c4d7559 Dave Watson 2017-06-14   739   goto send_end;
3c4d7559 Dave Watson 2017-06-14   740   }
3c4d7559 Dave Watson 2017-06-14   741  
a42055e8 Vakul Garg  2018-09-21   742   rec = get_rec(sk);
a42055e8 Vakul Garg  2018-09-21   743   if (!rec) {
a42055e8 Vakul Garg  2018-09-21   744   ret = -ENOMEM;
a42055e8 Vakul Garg  2018-09-21   745   goto send_end;

[kbuild] [linux-next:master 4137/5712] drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link.c:904 dc_link_get_hpd_state() error: we previously assumed 'hpd_pin' could be null (see line 900)

2018-09-23 Thread Dan Carpenter
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 
master
head:   46c163a036b41a29b0ec3c475bf97515d755ff41
commit: 16f4c69549ef676bc278be8b267a811b6f8f59ad [4137/5712] drm/amd/display: 
add query HPD interface.

smatch warnings:
drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link.c:904 
dc_link_get_hpd_state() error: we previously assumed 'hpd_pin' could be null 
(see line 900)

# 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=16f4c69549ef676bc278be8b267a811b6f8f59ad
git remote add linux-next 
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update linux-next
git checkout 16f4c69549ef676bc278be8b267a811b6f8f59ad
vim +/hpd_pin +904 drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link.c

4562236b Harry Wentland 2017-09-12  892  
16f4c695 Chiawen Huang  2018-09-05  893  bool dc_link_get_hpd_state(struct 
dc_link *dc_link)
16f4c695 Chiawen Huang  2018-09-05  894  {
16f4c695 Chiawen Huang  2018-09-05  895 struct gpio *hpd_pin;
16f4c695 Chiawen Huang  2018-09-05  896 uint32_t state;
16f4c695 Chiawen Huang  2018-09-05  897  
16f4c695 Chiawen Huang  2018-09-05  898 hpd_pin = 
get_hpd_gpio(dc_link->ctx->dc_bios,
16f4c695 Chiawen Huang  2018-09-05  899 
dc_link->link_id, dc_link->ctx->gpio_service);
16f4c695 Chiawen Huang  2018-09-05 @900 if (hpd_pin == NULL)
16f4c695 Chiawen Huang  2018-09-05  901 ASSERT(false);
^
This just prints an error message and then we oops later.  We should
handle the error properly or remove this code and just oops.  An oops
will have all the relevant information in the stack trace.

16f4c695 Chiawen Huang  2018-09-05  902  
16f4c695 Chiawen Huang  2018-09-05  903 dal_gpio_open(hpd_pin, 
GPIO_MODE_INTERRUPT);
16f4c695 Chiawen Huang  2018-09-05 @904 dal_gpio_get_value(hpd_pin, 
);
16f4c695 Chiawen Huang  2018-09-05  905 dal_gpio_close(hpd_pin);
16f4c695 Chiawen Huang  2018-09-05  906 dal_gpio_destroy_irq(_pin);
16f4c695 Chiawen Huang  2018-09-05  907  
16f4c695 Chiawen Huang  2018-09-05 @908 return state;
16f4c695 Chiawen Huang  2018-09-05  909  }
16f4c695 Chiawen Huang  2018-09-05  910  

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation
___
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild