From patchwork Fri Apr 20 10:13:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 10352371 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 49A7660231 for ; Fri, 20 Apr 2018 10:14:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3927A2866C for ; Fri, 20 Apr 2018 10:14:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2DCDD28707; Fri, 20 Apr 2018 10:14:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3F822866C for ; Fri, 20 Apr 2018 10:14:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754528AbeDTKOE (ORCPT ); Fri, 20 Apr 2018 06:14:04 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:57276 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754360AbeDTKOD (ORCPT ); Fri, 20 Apr 2018 06:14:03 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w3KABYrF020705; Fri, 20 Apr 2018 10:14:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2017-10-26; bh=BMIHB6nFIbUNnPSI1lkXRNS2/qakM/5SF1Oh/LTcCsk=; b=VjGn1ipNZYemv13zx3U+rnSLeLNach+ZskLkj8g3FvBttZNXRZRJdX5nZUbrx6EqFBc8 Rjhljykk512WWOoiHvkiFnAXiVgnfv9RQvkcuzGZF8NsX7QLpMZ5g+ki6UZ+e1oG6Ho1 mDhzb9J+E3S4VivVMsRN4igEfz8S/B0OCPtAUNwGcppNg1uqn+WwIaHgAUEeCd3nVrZl kHWXY2ruLY5qlwmWEw6rIY+vinYA/KFkfFqSKb4HQ3XcG7OWwnoO8RKXMw+uiD8Tagbu XffAJener7wSy4vUBaGW0Wa4pF+Ud/2UH1I7Z3VqeN3KJVfwKRIpqLHud0efRJ0YRuac OA== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2hdrxpbx0a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Apr 2018 10:14:00 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w3KADxIZ012778 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Apr 2018 10:13:59 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w3KADxjD005365; Fri, 20 Apr 2018 10:13:59 GMT Received: from mwanda (/197.254.35.146) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 20 Apr 2018 03:13:58 -0700 Date: Fri, 20 Apr 2018 13:13:52 +0300 From: Dan Carpenter To: "Lad, Prabhakar" Cc: Mauro Carvalho Chehab , linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] media: vpbe_venc: potential uninitialized variable in ven_sub_dev_init() Message-ID: <20180420101352.GA30373@mwanda> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8868 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804200099 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Smatch complains that "venc" could be unintialized. There a couple error paths where it looks like maybe that could happen. I don't know if it's really a bug, but it's reasonable to set "venc" to NULL and silence the warning. Signed-off-by: Dan Carpenter diff --git a/drivers/media/platform/davinci/vpbe_venc.c b/drivers/media/platform/davinci/vpbe_venc.c index 5c255de3b3f8..ba157827192c 100644 --- a/drivers/media/platform/davinci/vpbe_venc.c +++ b/drivers/media/platform/davinci/vpbe_venc.c @@ -606,7 +606,7 @@ static int venc_device_get(struct device *dev, void *data) struct v4l2_subdev *venc_sub_dev_init(struct v4l2_device *v4l2_dev, const char *venc_name) { - struct venc_state *venc; + struct venc_state *venc = NULL; bus_for_each_dev(&platform_bus_type, NULL, &venc, venc_device_get);