Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp823665lqo; Wed, 8 May 2024 16:56:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUtqb/FNM1Rlx4iLjPMe2LJjsgqZowiW+szEN+sQJo1OocelIIXYe8tPql+kShj0D1fW7mE6bnxTU9A3ZcxM7TxwOPuTSZVp8lVI3d9EA== X-Google-Smtp-Source: AGHT+IGNRnL4UQMV+x3w77Vtrhy84h0+KdQPh4l5jibLaYjM1Ewo40UnpNgTG0wOZBEy7a1XU8+j X-Received: by 2002:a05:6214:d6f:b0:6a0:d701:3e2f with SMTP id 6a1803df08f44-6a1514e62bdmr52215606d6.56.1715212561390; Wed, 08 May 2024 16:56:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715212561; cv=pass; d=google.com; s=arc-20160816; b=d93jXGtMFNKvDRM3KNvOgwtBxXqeCEBlXFbFIfMDxV6jN8KYqv9ja3zWxp3vUXyASr 2PCHQJor5/KvU3O7pAjrTYa43ZtGU0q/n7yMp39c96HBNE4Mcz0FL46ZAva9UFNqh91P nB4IFI3KSOVWvEgD+LlOwJB4WaiXiJDEWAWIBwOaqRrjmAVMmzZNQKd62egnzJNUvB42 SLwBY6UTjyoPmF+5jBe+Y31ukzU7wVtWBrQJjDL2xByDJmymEV0vBwpPuv2S76DiE88G PB2fOzMbbHY5+9xbl2nexLXRNIEKprB7JAQJVOoeV+HsEXy6Gw4I1yS5CG+X4LifU1yz nwQg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ffkibL6N8/dfvetGIAU9Tkb5z/GicciSKK6VCPiM8ok=; fh=qTlRTStUQQ7lk2JPUQGkB7el8jDYutiLNgxL9ztiMwo=; b=aeih+E6ipbiu7qjcFI0kh+/6ta4wJv3CH7MxDcR9sCCkU/oVwtQfGZFe3+fJLkgrCk 2B+TL9Y9H6r6wkqG34AJ+Sn2+Zdei5OCUjAngKORh/McTtlCBNudbBCJAfpKH3iy7CSA GbwZ8qCDfviI8xHELK3gexd1xEsTevx2a5qdVlLk/p3mCarykWr/iX+ziB1ssucqlRin URssvZ4JDv+XgvBl0yDxQpqxR/2kv10WEGMFWNvDEpk7fbS+nCmug0e34J4iaAVBc87/ jWt/T/+suRc2m2Ek7H7YRT9hQgZ/unEZhfwRuU18OOI01dlTSGncY4oSpC261xGkt6fz RQWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mRT8jxVP; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-173952-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173952-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f2e3b63si2353496d6.427.2024.05.08.16.56.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 16:56:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-173952-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mRT8jxVP; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-173952-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-173952-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 0FB4E1C21351 for ; Wed, 8 May 2024 23:56:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E680D1339AB; Wed, 8 May 2024 23:55:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="mRT8jxVP" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F1DBB34CDD for ; Wed, 8 May 2024 23:55:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715212555; cv=none; b=KVg5t1cFIXu5n2tXx6QrpCqeckMJ7oKYltsDdfyVf/qa8mhrXNUxtwka2fNXbDYgbTCnriZZxmdgdYza0g79KF7zNq2yx6iZJ3Px6w9X5uSfb33S+Dfa+xZFaU2kez7Uu9wKv3gYZyYfNkDNoMM27fN74tijFi3GAkwx37SO1/I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715212555; c=relaxed/simple; bh=9rINs3VyCm6tAEZfoaCS30hypmdP4mKel8NcCO8rrfs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=k8hCZ44nQ5WHByRhtCiUGrmeXkNc7thxy4fZciiQy39cIG+qiO1OkqgPzI8NkuKTqufe5pNBifQeiy+LSwFhaOoBV4KCCyMpscNEAHH3D12n93nieAG4/Gs+4STQW7cIQajZ0o7pUXr1kA9Y0EjMj5lo/e76/PHLOGn9L4QWSVY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=mRT8jxVP; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715212552; x=1746748552; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=9rINs3VyCm6tAEZfoaCS30hypmdP4mKel8NcCO8rrfs=; b=mRT8jxVPPJ0MTZwryu8M2YteIB4z8p/RHW4fqJ+8jvlDJqiK3nAbUm90 53S9YIwjpgFGprn0cWf90EDipX0DoEHrKrS0Mg1B+zgjoIimueTndW6wD IbXYTxR7/d13tCkzSlM7DYv8a6w1dP/CIZN6H23ysmEHBlwiYMgzV2qsK BHPCHrTG54+EG4nFcbauPSbnOT0btw536fc5gadDeSBRq7GpwOFfWHq5p UxQiw2JRwQHwI/5nrUleCq2Z+VwowFlwCYICb6x7mmHT+EIYgBLOeqGpO M+/ECX+6J2GQ6g3eo9ZyWV52c+p9sKjBo1CZqdW8zUh4CQR5i7fxeyH7Z A==; X-CSE-ConnectionGUID: VHtqR5FLRHWBAdy2ogIQSA== X-CSE-MsgGUID: O8kVFuAdSZq234m8vBCbfw== X-IronPort-AV: E=McAfee;i="6600,9927,11067"; a="10956797" X-IronPort-AV: E=Sophos;i="6.08,146,1712646000"; d="scan'208";a="10956797" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2024 16:55:52 -0700 X-CSE-ConnectionGUID: X/OteO3aRomYYA8wFp2YLg== X-CSE-MsgGUID: f5oQNoN6QmeVs2GRYmxOeg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,146,1712646000"; d="scan'208";a="28936000" Received: from lkp-server01.sh.intel.com (HELO f8b243fe6e68) ([10.239.97.150]) by orviesa010.jf.intel.com with ESMTP; 08 May 2024 16:55:48 -0700 Received: from kbuild by f8b243fe6e68 with local (Exim 4.96) (envelope-from ) id 1s4r8T-0004F6-1w; Wed, 08 May 2024 23:55:45 +0000 Date: Thu, 9 May 2024 07:55:43 +0800 From: kernel test robot To: Weishi Li , airlied@redhat.com, kraxel@redhat.com, gurchetansingh@chromium.org, olvaffe@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, daniel@ffwll.ch Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, dri-devel@lists.freedesktop.org, virtualization@lists.linux.dev, linux-kernel@vger.kernel.org, liweishi@kylinos.cn Subject: Re: [PATCH] [PATCH RESEND] drm/virtio: fix memory leak of vbuf Message-ID: <202405090747.y8ofUE7r-lkp@intel.com> References: <20240507033814.57906-1-liweishi@kylinos.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240507033814.57906-1-liweishi@kylinos.cn> Hi Weishi, kernel test robot noticed the following build warnings: [auto build test WARNING on drm-misc/drm-misc-next] [also build test WARNING on drm/drm-next linus/master v6.9-rc7 next-20240508] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Weishi-Li/drm-virtio-fix-memory-leak-of-vbuf/20240507-114452 base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next patch link: https://lore.kernel.org/r/20240507033814.57906-1-liweishi%40kylinos.cn patch subject: [PATCH] [PATCH RESEND] drm/virtio: fix memory leak of vbuf config: i386-buildonly-randconfig-001-20240508 (https://download.01.org/0day-ci/archive/20240509/202405090747.y8ofUE7r-lkp@intel.com/config) compiler: clang version 18.1.4 (https://github.com/llvm/llvm-project e6c3289804a67ea0bb6a86fadbe454dd93b8d855) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240509/202405090747.y8ofUE7r-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202405090747.y8ofUE7r-lkp@intel.com/ All warnings (new ones prefixed by >>): >> drivers/gpu/drm/virtio/virtgpu_vq.c:474:13: warning: variable 'notify' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] 474 | } else if (ret < 0) { | ^~~~~~~ drivers/gpu/drm/virtio/virtgpu_vq.c:487:6: note: uninitialized use occurs here 487 | if (notify) | ^~~~~~ drivers/gpu/drm/virtio/virtgpu_vq.c:474:9: note: remove the 'if' if its condition is always false 474 | } else if (ret < 0) { | ^~~~~~~~~~~~~~ 475 | free_vbuf(vgdev, vbuf); | ~~~~~~~~~~~~~~~~~~~~~~~ 476 | } else { | ~~~~~~ drivers/gpu/drm/virtio/virtgpu_vq.c:455:13: note: initialize the variable 'notify' to silence this warning 455 | bool notify; | ^ | = 0 1 warning generated. vim +474 drivers/gpu/drm/virtio/virtgpu_vq.c 448 449 static void virtio_gpu_queue_cursor(struct virtio_gpu_device *vgdev, 450 struct virtio_gpu_vbuffer *vbuf) 451 { 452 struct virtqueue *vq = vgdev->cursorq.vq; 453 struct scatterlist *sgs[1], ccmd; 454 int idx, ret, outcnt; 455 bool notify; 456 457 if (!drm_dev_enter(vgdev->ddev, &idx)) { 458 free_vbuf(vgdev, vbuf); 459 return; 460 } 461 462 sg_init_one(&ccmd, vbuf->buf, vbuf->size); 463 sgs[0] = &ccmd; 464 outcnt = 1; 465 466 spin_lock(&vgdev->cursorq.qlock); 467 retry: 468 ret = virtqueue_add_sgs(vq, sgs, outcnt, 0, vbuf, GFP_ATOMIC); 469 if (ret == -ENOSPC) { 470 spin_unlock(&vgdev->cursorq.qlock); 471 wait_event(vgdev->cursorq.ack_queue, vq->num_free >= outcnt); 472 spin_lock(&vgdev->cursorq.qlock); 473 goto retry; > 474 } else if (ret < 0) { 475 free_vbuf(vgdev, vbuf); 476 } else { 477 vbuf->seqno = ++vgdev->cursorq.seqno; 478 trace_virtio_gpu_cmd_queue(vq, 479 virtio_gpu_vbuf_ctrl_hdr(vbuf), 480 vbuf->seqno); 481 482 notify = virtqueue_kick_prepare(vq); 483 } 484 485 spin_unlock(&vgdev->cursorq.qlock); 486 487 if (notify) 488 virtqueue_notify(vq); 489 490 drm_dev_exit(idx); 491 } 492 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki