From owner-svn-src-releng@freebsd.org Thu Sep 26 23:27:25 2019 Return-Path: Delivered-To: svn-src-releng@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DDDC136CF2; Thu, 26 Sep 2019 23:27:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46fWL50R82z45Hp; Thu, 26 Sep 2019 23:27:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E79447E59; Thu, 26 Sep 2019 23:27:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x8QNROlj038580; Thu, 26 Sep 2019 23:27:24 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x8QNROan038579; Thu, 26 Sep 2019 23:27:24 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201909262327.x8QNROan038579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 26 Sep 2019 23:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r352779 - releng/12.1/sys/cam/scsi X-SVN-Group: releng X-SVN-Commit-Author: mav X-SVN-Commit-Paths: releng/12.1/sys/cam/scsi X-SVN-Commit-Revision: 352779 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-releng@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the release engineering / security commits to the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Sep 2019 23:27:25 -0000 Author: mav Date: Thu Sep 26 23:27:24 2019 New Revision: 352779 URL: https://svnweb.freebsd.org/changeset/base/352779 Log: MFS r352772: MFC r349342 (by imp): Use the cam_ed copy of ata_params rather than malloc and freeing memory for it. This reaches into internal bits of xpt a little, and I'll clean that up later. Reviewed by: imp Approved by: re (gjb) Modified: releng/12.1/sys/cam/scsi/scsi_da.c Directory Properties: releng/12.1/ (props changed) Modified: releng/12.1/sys/cam/scsi/scsi_da.c ============================================================================== --- releng/12.1/sys/cam/scsi/scsi_da.c Thu Sep 26 21:12:47 2019 (r352778) +++ releng/12.1/sys/cam/scsi/scsi_da.c Thu Sep 26 23:27:24 2019 (r352779) @@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef _KERNEL +#include +#endif /* _KERNEL */ #include #include @@ -3598,16 +3601,8 @@ out: break; } - ata_params = (struct ata_params*) - malloc(sizeof(*ata_params), M_SCSIDA,M_NOWAIT|M_ZERO); + ata_params = &periph->path->device->ident_data; - if (ata_params == NULL) { - xpt_print(periph->path, "Couldn't malloc ata_params " - "data\n"); - /* da_free_periph??? */ - break; - } - scsi_ata_identify(&start_ccb->csio, /*retries*/da_retry_count, /*cbfcnp*/dadone_probeata, @@ -5276,7 +5271,6 @@ dadone_probeata(struct cam_periph *periph, union ccb * } } - free(ata_params, M_SCSIDA); if ((softc->zone_mode == DA_ZONE_HOST_AWARE) || (softc->zone_mode == DA_ZONE_HOST_MANAGED)) { /*