From patchwork Mon Mar 20 14:40:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Cox X-Patchwork-Id: 9634325 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 CC0486020B for ; Mon, 20 Mar 2017 14:43:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC3222003F for ; Mon, 20 Mar 2017 14:43:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ADC4228450; Mon, 20 Mar 2017 14:43:14 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 2FCB327D8D for ; Mon, 20 Mar 2017 14:43:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754719AbdCTOnI (ORCPT ); Mon, 20 Mar 2017 10:43:08 -0400 Received: from mga06.intel.com ([134.134.136.31]:29595 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753283AbdCTOmE (ORCPT ); Mon, 20 Mar 2017 10:42:04 -0400 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP; 20 Mar 2017 07:40:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,194,1486454400"; d="scan'208";a="946242761" Received: from acox1-desk1.ger.corp.intel.com ([10.252.22.109]) by orsmga003.jf.intel.com with ESMTP; 20 Mar 2017 07:40:41 -0700 Subject: [PATCH 11/24] Staging: atomisp: fix an uninitialized variable bug From: Alan Cox To: greg@kroah.com, linux-media@vger.kernel.org Date: Mon, 20 Mar 2017 14:40:41 +0000 Message-ID: <149002083976.17109.17791242315002796691.stgit@acox1-desk1.ger.corp.intel.com> In-Reply-To: <149002068431.17109.1216139691005241038.stgit@acox1-desk1.ger.corp.intel.com> References: <149002068431.17109.1216139691005241038.stgit@acox1-desk1.ger.corp.intel.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 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 From: Dan Carpenter There are some error paths in atomisp_css_frame_allocate() which don't initialize "res" so it could lead us to try release random memory. Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Signed-off-by: Dan Carpenter Signed-off-by: Alan Cox --- .../media/atomisp/pci/atomisp2/atomisp_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c index 08da8ea..37d334e 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c @@ -4722,7 +4722,7 @@ static int atomisp_v4l2_framebuffer_to_css_frame(const struct v4l2_framebuffer *arg, struct atomisp_css_frame **result) { - struct atomisp_css_frame *res; + struct atomisp_css_frame *res = NULL; unsigned int padded_width; enum atomisp_css_frame_format sh_format; char *tmp_buf = NULL;